Просмотр исходного кода

chore: fix enable cache being removed on installCRD=false (#6799)

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Gergely Bräutigam 3 недель назад
Родитель
Сommit
fc094168e3

+ 1 - 0
deploy/charts/external-secrets/README.md

@@ -40,6 +40,7 @@ The command removes all the Kubernetes components associated with the chart and
 | certController.affinity | object | `{}` |  |
 | certController.create | bool | `true` | Specifies whether a certificate controller deployment be created. |
 | certController.deploymentAnnotations | object | `{}` | Annotations to add to Deployment |
+| certController.enablePartialCache | bool | `true` | Restrict the cert controller's informer cache to CustomResourceDefinitions and ValidatingWebhookConfigurations carrying the `external-secrets.io/component` label. Disable this only if the CRDs it manages were installed without that label. |
 | certController.extraArgs | object | `{}` |  |
 | certController.extraEnv | list | `[]` |  |
 | certController.extraInitContainers | list | `[]` |  |

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

@@ -83,7 +83,7 @@ spec:
           - --crd-names=externalsecrets.external-secrets.io
           - --crd-names=secretstores.external-secrets.io
           {{- end }}
-          {{- if .Values.installCRDs }}
+          {{- if .Values.certController.enablePartialCache }}
           - --enable-partial-cache=true
           {{- end }}
           {{- if .Values.enableHTTP2 }}

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

@@ -377,3 +377,21 @@ tests:
       - contains:
           path: spec.template.spec.containers[0].args
           content: "--enable-leader-election=true"
+  - it: should have enable-partial-cache flag when installCRDs is false
+    set:
+      installCRDs: false
+    templates:
+      - cert-controller-deployment.yaml
+    asserts:
+      - contains:
+          path: spec.template.spec.containers[0].args
+          content: "--enable-partial-cache=true"
+  - it: should not have enable-partial-cache flag when disabled
+    set:
+      certController.enablePartialCache: false
+    templates:
+      - cert-controller-deployment.yaml
+    asserts:
+      - notContains:
+          path: spec.template.spec.containers[0].args
+          content: "--enable-partial-cache=true"

+ 3 - 0
deploy/charts/external-secrets/values.schema.json

@@ -28,6 +28,9 @@
                 "deploymentAnnotations": {
                     "type": "object"
                 },
+                "enablePartialCache": {
+                    "type": "boolean"
+                },
                 "extraArgs": {
                     "type": "object"
                 },

+ 4 - 0
deploy/charts/external-secrets/values.yaml

@@ -765,6 +765,10 @@ certController:
   create: true
   requeueInterval: "5m"
   replicaCount: 1
+  # -- Restrict the cert controller's informer cache to CustomResourceDefinitions and
+  # ValidatingWebhookConfigurations carrying the `external-secrets.io/component` label.
+  # Disable this only if the CRDs it manages were installed without that label.
+  enablePartialCache: true
   # -- Specifies Log Params to the Certificate Controller
   log:
     level: info