Skip to content

Commit a82ad34

Browse files
committed
[rollout-operator] Apply suggested changes
1 parent 882a455 commit a82ad34

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

charts/rollout-operator/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ Create the image name
9292
{{- (printf "%s:%s" .Values.image.repository $imageTag) }}
9393
{{- end -}}
9494
{{- end -}}
95+
96+
{{- define "rollout-operator.secretName" -}}
97+
{{- if .Values.webhook.selfSignedCertSecretName }}
98+
{{- .Values.webhook.selfSignedCertSecretName }}
99+
{{- else }}
100+
{{- include "rollout-operator.fullname" . }}
101+
{{- end }}
102+
{{- end }}

charts/rollout-operator/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
- -kubernetes.namespace={{ .Release.Namespace }}
5454
{{- if .Values.webhooks.enabled }}
5555
- -server-tls.enabled=true
56-
- -server-tls.self-signed-cert.secret-name={{ .Values.webhooks.selfSignedCertSecretName | default (include "rollout-operator.fullname" . ) }}
56+
- -server-tls.self-signed-cert.secret-name={{ include "rollout-operator.secretName" . }}
5757
- -server-tls.self-signed-cert.dns-name={{ include "rollout-operator.fullname" . }}.{{ .Release.Namespace }}.svc
5858
{{- end }}
5959
{{- range .Values.extraArgs }}

charts/rollout-operator/templates/webhook-role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rules:
1313
- update
1414
- get
1515
resourceNames:
16-
- {{ .Values.webhooks.selfSignedCertSecretName | default (include "rollout-operator.fullname" . ) }}
16+
- {{ include "rollout-operator.secretName" . }}
1717
- apiGroups:
1818
- ""
1919
resources:

charts/rollout-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ webhooks:
106106
enabled: true
107107
# -- Validating and mutating webhook failure policy. `Ignore` or `Fail`.
108108
failurePolicy: "Fail"
109-
# -- Secret resource name for the TLS certificate to be used with the webhooks
109+
# -- Secret resource name for the TLS certificate to be used with the webhooks. If not set, a secret's name will be generated using the fullname template.
110110
selfSignedCertSecretName: ""
111111
# -- objectSelector to filter which objects the webhooks apply to.
112112
objectSelector: {}

0 commit comments

Comments
 (0)