diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index a1e4492cf2..34f44153ac 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -194,10 +194,12 @@ spec: - -external-service={{ .Values.controller.reportIngressStatus.externalService }} {{- else if and (.Values.controller.service.create) (eq .Values.controller.service.type "LoadBalancer") }} - -external-service={{ include "nginx-ingress.serviceName" . }} +{{- end }} {{- end }} - -enable-leader-election={{ .Values.controller.reportIngressStatus.enableLeaderElection }} + {{- if .Values.controller.reportIngressStatus.enableLeaderElection }} - -leader-election-lock-name={{ include "nginx-ingress.leaderElectionName" . }} -{{- end }} + {{- end }} {{- if .Values.controller.wildcardTLS.secret }} - -wildcard-tls-secret={{ .Values.controller.wildcardTLS.secret }} {{- else if and .Values.controller.wildcardTLS.cert .Values.controller.wildcardTLS.key }} diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index cb096e2694..35eedf5e9d 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -197,8 +197,10 @@ spec: - -external-service={{ .Values.controller.reportIngressStatus.externalService }} {{- else if and (.Values.controller.service.create) (eq .Values.controller.service.type "LoadBalancer") }} - -external-service={{ include "nginx-ingress.serviceName" . }} +{{- end }} {{- end }} - -enable-leader-election={{ .Values.controller.reportIngressStatus.enableLeaderElection }} +{{- if .Values.controller.reportIngressStatus.enableLeaderElection }} - -leader-election-lock-name={{ include "nginx-ingress.leaderElectionName" . }} {{- end }} {{- if .Values.controller.wildcardTLS.secret }} diff --git a/deployments/helm-chart/templates/controller-leader-election-configmap.yaml b/deployments/helm-chart/templates/controller-leader-election-configmap.yaml index ef6f79a581..a473c69a7a 100644 --- a/deployments/helm-chart/templates/controller-leader-election-configmap.yaml +++ b/deployments/helm-chart/templates/controller-leader-election-configmap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.controller.reportIngressStatus.enableLeaderElection }} apiVersion: v1 kind: ConfigMap metadata: @@ -5,7 +6,8 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "nginx-ingress.labels" . | nindent 4 }} -{{- if .Values.controller.reportIngressStatus.annotations }} - annotations: -{{ toYaml .Values.controller.reportIngressStatus.annotations | indent 4 }} -{{- end }} + {{- if .Values.controller.reportIngressStatus.annotations }} +annotations: + {{ toYaml .Values.controller.reportIngressStatus.annotations | indent 4 }} + {{- end }} + {{- end }}