Browse Source

feat(charts): add new flag enable leader for cert-manager (#5863)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gergely Bräutigam <skarlso777@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Co-authored-by: Umaid Abbasi <91631027+umizoom@users.noreply.github.com>
Co-authored-by: Joshua N Haupt <joshuanhaupt@outlook.com>
Co-authored-by: n4zukker <n4zukker@users.noreply.github.com>
Co-authored-by: Remy Bertot <stripthis@users.noreply.github.com>
Co-authored-by: Moritz Johner <moolen@users.noreply.github.com>
Co-authored-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
Co-authored-by: Jean-Philippe Evrard <jean-philippe.evrard+rochepub@external.roche.com>
Co-authored-by: Jan Lauber <jan.lauber@protonmail.ch>
Co-authored-by: varonix <62331820+varonix0@users.noreply.github.com>
Co-authored-by: lochan_2112 <rn.lochan@gmail.com>
Co-authored-by: Fan Zhang <m42zhang@uwaterloo.ca>
Co-authored-by: Gergely Bräutigam <gergely.brautigam@sap.com>
Nutmos 1 month ago
parent
commit
0ed2729ef0

+ 3 - 0
deploy/charts/external-secrets/templates/cert-controller-deployment.yaml

@@ -89,6 +89,9 @@ spec:
           {{- if .Values.enableHTTP2 }}
           {{- if .Values.enableHTTP2 }}
           - --enable-http2=true
           - --enable-http2=true
           {{- end }}
           {{- end }}
+          {{- if .Values.leaderElect }}
+          - --enable-leader-election=true
+          {{- end }}
           {{- range $key, $value := .Values.certController.extraArgs }}
           {{- range $key, $value := .Values.certController.extraArgs }}
             {{- if $value }}
             {{- if $value }}
           - --{{ $key }}={{ $value }}
           - --{{ $key }}={{ $value }}

+ 16 - 0
deploy/charts/external-secrets/tests/cert_controller_test.yaml

@@ -373,3 +373,19 @@ tests:
             - ip: "192.168.1.100"
             - ip: "192.168.1.100"
               hostnames:
               hostnames:
                 - "cert.example.com"
                 - "cert.example.com"
+  - it: should not have enable-leader-election flag by default
+    templates:
+      - cert-controller-deployment.yaml
+    asserts:
+      - notContains:
+          path: spec.template.spec.containers[0].args
+          content: "--enable-leader-election=true"
+  - it: should have enable-leader-election flag when leaderElect is true
+    set:
+      leaderElect: true
+    templates:
+      - cert-controller-deployment.yaml
+    asserts:
+      - contains:
+          path: spec.template.spec.containers[0].args
+          content: "--enable-leader-election=true"