fix: allow custom selectors without dict merges

This commit is contained in:
Toboshii Nakama 2021-08-02 15:58:48 -05:00
parent f1d6009768
commit fb898031b4
2 changed files with 13 additions and 7 deletions

View File

@ -10,7 +10,12 @@ webhooks:
- name: "{{ include "common.names.fullname" . }}.svc.cluster.local" - name: "{{ include "common.names.fullname" . }}.svc.cluster.local"
namespaceSelector: namespaceSelector:
{{- with .Values.webhook.namespaceSelector }} {{- with .Values.webhook.namespaceSelector }}
{{ toYaml . | nindent 4 }} {{- if eq .type "label" }}
matchLabels:
{{ .label }}: "true"
{{- else if eq .type "custom" }}
{{- toYaml .custom | nindent 4 }}
{{- end }}
{{- end }} {{- end }}
rules: rules:
- apiGroups: [""] - apiGroups: [""]

View File

@ -119,8 +119,9 @@ webhook:
# **IMPORTANT**: Do not select the namespace where the webhook # **IMPORTANT**: Do not select the namespace where the webhook
# is deployed to or you will get locking issues. # is deployed to or you will get locking issues.
namespaceSelector: namespaceSelector:
matchLabels: type: label
routed-gateway: "true" label: "routed-gateway"
custom: {}
# matchExpressions: # matchExpressions:
# - key: notTouch # - key: notTouch
# operator: NotIn # operator: NotIn