Skip to content

Commit 4a7b3e1

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

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

charts/rollout-operator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ Manually applying these CRDs is only required if upgrading from a chart <= v0.32
8585
| tolerations | list | `[]` | |
8686
| webhooks.enabled | bool | `true` | Enable the rollout-operator webhooks. See https://github.com/grafana/rollout-operator/#webhooks. Note that the webhooks require custom resource definitions. If upgrading, manually apply the files in the `crds` directory. |
8787
| webhooks.failurePolicy | string | `"Fail"` | Validating and mutating webhook failure policy. `Ignore` or `Fail`. |
88-
| webhooks.selfSignedCertSecretName | string | `""` | Secret resource name for the TLS certificate to be used with the webhooks |
88+
| webhooks.selfSignedCertSecretName | string | `""` | 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. |
8989
| webhooks.objectSelector | object | `{}` | objectSelector to filter which objects the webhooks apply to. |

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)