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"
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 }}
rules:
- apiGroups: [""]

View File

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