From c1472be33a74d5df1f4231ff6c5e449b83e40402 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:26:01 +0100 Subject: [PATCH] fix(metrics-operator): remove duplicated CA injection annotations (#3232) Signed-off-by: odubajDT --- .../scripts/.helm-tests/default/result.yaml | 1 - .../result.yaml | 31 +++++++++++++++- .../values.yaml | 2 + .../.helm-tests/metrics-only/result.yaml | 37 ++++++++++++++++++- .../.helm-tests/metrics-only/values.yaml | 2 + .../metrics-with-certs/result.yaml | 1 - .../chart/templates/analysis-crd.yaml | 3 +- .../templates/analysisdefinition-crd.yaml | 2 +- .../templates/analysisvaluetemplate-crd.yaml | 2 +- .../chart/templates/keptnmetric-crd.yaml | 2 +- .../templates/keptnmetricsprovider-crd.yaml | 2 +- 11 files changed, 75 insertions(+), 10 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index f2941c714d..c36b198db8 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -8076,7 +8076,6 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs - cert-manager.io/inject-ca-from: 'helmtests/keptn-certs' labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/result.yaml b/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/result.yaml index d2de379456..875504806e 100644 --- a/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/result.yaml +++ b/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/result.yaml @@ -5,6 +5,8 @@ kind: ServiceAccount metadata: name: metrics-operator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -18,6 +20,8 @@ kind: ConfigMap metadata: name: metrics-operator-config namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -46,7 +50,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs - cert-manager.io/inject-ca-from: 'helmtests/keptn-certs' + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -402,6 +406,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1099,6 +1104,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1248,6 +1254,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1785,6 +1792,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -2005,6 +2013,8 @@ kind: ClusterRole metadata: name: metrics-operator-role namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2113,6 +2123,8 @@ kind: ClusterRole metadata: name: metrics-operator-server-resources namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2135,6 +2147,8 @@ kind: ClusterRoleBinding metadata: name: metrics-operator-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2156,6 +2170,8 @@ kind: ClusterRoleBinding metadata: name: system-auth-delegator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2177,6 +2193,8 @@ kind: Role metadata: name: metrics-operator-leader-election-role namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2222,6 +2240,8 @@ kind: RoleBinding metadata: name: metrics-operator-leader-election-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2243,6 +2263,8 @@ kind: RoleBinding metadata: name: metrics-operator-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2264,6 +2286,8 @@ kind: Service metadata: name: metrics-operator-service namespace: "helmtests" + annotations: + test/jj: test labels: control-plane: metrics-operator app.kubernetes.io/instance: keptn-test @@ -2296,6 +2320,8 @@ kind: Service metadata: name: metrics-webhook-service namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2319,6 +2345,8 @@ kind: Deployment metadata: name: metrics-operator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/part-of: keptn app.kubernetes.io/component: metrics-operator @@ -2436,6 +2464,7 @@ kind: ValidatingWebhookConfiguration metadata: name: metrics-validating-webhook-configuration annotations: + test/jj: test cert-manager.io/inject-ca-from: helmtests/keptn-certs labels: keptn.sh/inject-cert: "true" diff --git a/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/values.yaml b/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/values.yaml index a7ab1dec98..63e4750158 100644 --- a/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/values.yaml +++ b/.github/scripts/.helm-tests/metrics-only-with-apiservice-disabled/values.yaml @@ -14,3 +14,5 @@ global: app.kubernetes.io/version: vmyversion caInjectionAnnotations: cert-manager.io/inject-ca-from: helmtests/keptn-certs + commonAnnotations: + test/jj: test diff --git a/.github/scripts/.helm-tests/metrics-only/result.yaml b/.github/scripts/.helm-tests/metrics-only/result.yaml index 15a3177ada..2c6c5633d8 100644 --- a/.github/scripts/.helm-tests/metrics-only/result.yaml +++ b/.github/scripts/.helm-tests/metrics-only/result.yaml @@ -5,6 +5,8 @@ kind: ServiceAccount metadata: name: metrics-operator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -18,6 +20,8 @@ kind: ConfigMap metadata: name: metrics-operator-config namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -46,7 +50,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs - cert-manager.io/inject-ca-from: 'helmtests/keptn-certs' + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -402,6 +406,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1099,6 +1104,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1248,6 +1254,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -1785,6 +1792,7 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs + test/jj: test labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh @@ -2005,6 +2013,8 @@ kind: ClusterRole metadata: name: metrics-operator-role namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2113,6 +2123,8 @@ kind: ClusterRole metadata: name: metrics-operator-server-resources namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2135,6 +2147,8 @@ kind: ClusterRoleBinding metadata: name: metrics-operator-hpa-controller namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2156,6 +2170,8 @@ kind: ClusterRoleBinding metadata: name: metrics-operator-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2177,6 +2193,8 @@ kind: ClusterRoleBinding metadata: name: system-auth-delegator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2198,6 +2216,8 @@ kind: Role metadata: name: metrics-operator-leader-election-role namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2243,6 +2263,8 @@ kind: RoleBinding metadata: name: metrics-operator-leader-election-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2264,6 +2286,8 @@ kind: RoleBinding metadata: name: metrics-operator-rolebinding namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2285,6 +2309,8 @@ kind: Service metadata: name: metrics-operator-service namespace: "helmtests" + annotations: + test/jj: test labels: control-plane: metrics-operator app.kubernetes.io/instance: keptn-test @@ -2317,6 +2343,8 @@ kind: Service metadata: name: metrics-webhook-service namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2340,6 +2368,8 @@ kind: Deployment metadata: name: metrics-operator namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/part-of: keptn app.kubernetes.io/component: metrics-operator @@ -2457,6 +2487,8 @@ kind: APIService metadata: name: v1beta1.custom.metrics.k8s.io namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2479,6 +2511,8 @@ kind: APIService metadata: name: v1beta2.custom.metrics.k8s.io namespace: "helmtests" + annotations: + test/jj: test labels: app.kubernetes.io/instance: keptn-test app.kubernetes.io/managed-by: Helm @@ -2501,6 +2535,7 @@ kind: ValidatingWebhookConfiguration metadata: name: metrics-validating-webhook-configuration annotations: + test/jj: test cert-manager.io/inject-ca-from: helmtests/keptn-certs labels: keptn.sh/inject-cert: "true" diff --git a/.github/scripts/.helm-tests/metrics-only/values.yaml b/.github/scripts/.helm-tests/metrics-only/values.yaml index b6e3830029..42eb13afc9 100644 --- a/.github/scripts/.helm-tests/metrics-only/values.yaml +++ b/.github/scripts/.helm-tests/metrics-only/values.yaml @@ -11,3 +11,5 @@ global: app.kubernetes.io/version: vmyversion caInjectionAnnotations: cert-manager.io/inject-ca-from: helmtests/keptn-certs + commonAnnotations: + test/jj: test diff --git a/.github/scripts/.helm-tests/metrics-with-certs/result.yaml b/.github/scripts/.helm-tests/metrics-with-certs/result.yaml index 12315a3134..1538d1b491 100644 --- a/.github/scripts/.helm-tests/metrics-with-certs/result.yaml +++ b/.github/scripts/.helm-tests/metrics-with-certs/result.yaml @@ -61,7 +61,6 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 cert-manager.io/inject-ca-from: helmtests/keptn-certs - cert-manager.io/inject-ca-from: 'helmtests/keptn-certs' labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/metrics-operator/chart/templates/analysis-crd.yaml b/metrics-operator/chart/templates/analysis-crd.yaml index 66d7910334..698ce1c1ba 100644 --- a/metrics-operator/chart/templates/analysis-crd.yaml +++ b/metrics-operator/chart/templates/analysis-crd.yaml @@ -7,8 +7,7 @@ metadata: {{- with .Values.global.caInjectionAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} - cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/keptn-certs' - {{- include "common.annotations" ( dict "context" . ) }} + {{- include "common.annotations" ( dict "context" . ) }} labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/metrics-operator/chart/templates/analysisdefinition-crd.yaml b/metrics-operator/chart/templates/analysisdefinition-crd.yaml index a3d15604c5..5e1a0bb121 100644 --- a/metrics-operator/chart/templates/analysisdefinition-crd.yaml +++ b/metrics-operator/chart/templates/analysisdefinition-crd.yaml @@ -7,7 +7,7 @@ metadata: {{- with .Values.global.caInjectionAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- include "common.annotations" ( dict "context" . ) }} + {{- include "common.annotations" ( dict "context" . ) }} labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/metrics-operator/chart/templates/analysisvaluetemplate-crd.yaml b/metrics-operator/chart/templates/analysisvaluetemplate-crd.yaml index 1e6726b27e..135a796dbc 100644 --- a/metrics-operator/chart/templates/analysisvaluetemplate-crd.yaml +++ b/metrics-operator/chart/templates/analysisvaluetemplate-crd.yaml @@ -7,7 +7,7 @@ metadata: {{- with .Values.global.caInjectionAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- include "common.annotations" ( dict "context" . ) }} + {{- include "common.annotations" ( dict "context" . ) }} labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/metrics-operator/chart/templates/keptnmetric-crd.yaml b/metrics-operator/chart/templates/keptnmetric-crd.yaml index c5e766a0d0..c6b903423f 100644 --- a/metrics-operator/chart/templates/keptnmetric-crd.yaml +++ b/metrics-operator/chart/templates/keptnmetric-crd.yaml @@ -7,7 +7,7 @@ metadata: {{- with .Values.global.caInjectionAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- include "common.annotations" ( dict "context" . ) }} + {{- include "common.annotations" ( dict "context" . ) }} labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh diff --git a/metrics-operator/chart/templates/keptnmetricsprovider-crd.yaml b/metrics-operator/chart/templates/keptnmetricsprovider-crd.yaml index f7c0edb183..d7d21c6c9d 100644 --- a/metrics-operator/chart/templates/keptnmetricsprovider-crd.yaml +++ b/metrics-operator/chart/templates/keptnmetricsprovider-crd.yaml @@ -7,7 +7,7 @@ metadata: {{- with .Values.global.caInjectionAnnotations }} {{- toYaml . | nindent 4 }} {{- end }} - {{- include "common.annotations" ( dict "context" . ) }} + {{- include "common.annotations" ( dict "context" . ) }} labels: app.kubernetes.io/part-of: keptn crdGroup: metrics.keptn.sh