mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-14 11:57:59 +00:00
chore(helm): Add extra labels to the validating webhooks (#4074)
It should add a bunch of app.kubernetes.io labels Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com> Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
This commit is contained in:
parent
d4d4f4bc4b
commit
a9ba8b2bc8
3 changed files with 15 additions and 7 deletions
|
@ -4,10 +4,8 @@ kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: secretstore-validate
|
name: secretstore-validate
|
||||||
labels:
|
labels:
|
||||||
|
{{- include "external-secrets-webhook.labels" . | nindent 4 }}
|
||||||
external-secrets.io/component: webhook
|
external-secrets.io/component: webhook
|
||||||
{{- with .Values.commonLabels }}
|
|
||||||
{{ toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
|
{{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: {{ template "external-secrets.namespace" . }}/{{ include "external-secrets.fullname" . }}-webhook
|
cert-manager.io/inject-ca-from: {{ template "external-secrets.namespace" . }}/{{ include "external-secrets.fullname" . }}-webhook
|
||||||
|
@ -50,10 +48,8 @@ kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: externalsecret-validate
|
name: externalsecret-validate
|
||||||
labels:
|
labels:
|
||||||
|
{{- include "external-secrets-webhook.labels" . | nindent 4 }}
|
||||||
external-secrets.io/component: webhook
|
external-secrets.io/component: webhook
|
||||||
{{- with .Values.commonLabels }}
|
|
||||||
{{ toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
|
{{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: {{ template "external-secrets.namespace" . }}/{{ include "external-secrets.fullname" . }}-webhook
|
cert-manager.io/inject-ca-from: {{ template "external-secrets.namespace" . }}/{{ include "external-secrets.fullname" . }}-webhook
|
||||||
|
|
|
@ -4,7 +4,7 @@ should match snapshot of default values:
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.16.3
|
controller-gen.kubebuilder.io/version: v0.16.5
|
||||||
labels:
|
labels:
|
||||||
external-secrets.io/component: controller
|
external-secrets.io/component: controller
|
||||||
name: secretstores.external-secrets.io
|
name: secretstores.external-secrets.io
|
||||||
|
|
|
@ -161,6 +161,18 @@ tests:
|
||||||
templates:
|
templates:
|
||||||
- validatingwebhook.yaml
|
- validatingwebhook.yaml
|
||||||
- crds/externalsecret.yaml
|
- crds/externalsecret.yaml
|
||||||
|
- it: should have the correct labels
|
||||||
|
set:
|
||||||
|
webhook.create: true
|
||||||
|
templates:
|
||||||
|
- validatingwebhook.yaml
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: metadata.labels["app.kubernetes.io/name"]
|
||||||
|
value: "external-secrets-webhook"
|
||||||
|
- equal:
|
||||||
|
path: metadata.labels["app.kubernetes.io/instance"]
|
||||||
|
value: "RELEASE-NAME"
|
||||||
- it: should override metrics port
|
- it: should override metrics port
|
||||||
set:
|
set:
|
||||||
webhook.metrics.listen.port: 8888
|
webhook.metrics.listen.port: 8888
|
||||||
|
|
Loading…
Reference in a new issue