diff --git a/charts/apisix-ingress-controller/templates/_helpers.tpl b/charts/apisix-ingress-controller/templates/_helpers.tpl index cf34bd71..08667a7a 100644 --- a/charts/apisix-ingress-controller/templates/_helpers.tpl +++ b/charts/apisix-ingress-controller/templates/_helpers.tpl @@ -79,11 +79,15 @@ Webhook service name - ensure it stays within 63 character limit {{- end }} {{/* -Webhook secret name - ensure it stays within 63 character limit +Webhook secret name - use value from values.yaml if provided, otherwise generate one */}} {{- define "apisix-ingress-controller-manager.webhook.secretName" -}} +{{- if and .Values.webhook.certificate.provided .Values.webhook.certificate.secretName -}} +{{- .Values.webhook.certificate.secretName -}} +{{- else -}} {{- $suffix := "-webhook-cert" -}} {{- $maxLen := sub 63 (len $suffix) | int -}} {{- $baseName := include "apisix-ingress-controller-manager.name.fullname" . | trunc $maxLen | trimSuffix "-" -}} {{- printf "%s%s" $baseName $suffix -}} +{{- end -}} {{- end }}