Skip to content

Commit bbf872a

Browse files
DerekTBrownGacko
andauthored
Apply suggestions from code review
Co-authored-by: Marco Ebert <[email protected]>
1 parent 5fd756c commit bbf872a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

charts/ingress-nginx/templates/controller-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
{{- include "ingress-nginx.labels" . | nindent 8 }}
4242
app.kubernetes.io/component: controller
4343
{{- if not .Values.controller.disableLeaderElection }}
44-
nginx.ingress.kubernetes.io/electionID: {{ include "ingress-nginx.controller.electionID" . }}
44+
nginx.ingress.kubernetes.io/election-id: {{ include "ingress-nginx.controller.electionID" . }}
4545
{{- end }}
4646
{{- with .Values.controller.labels }}
4747
{{- toYaml . | nindent 8 }}

charts/ingress-nginx/tests/controller-daemonset_test.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,29 +209,29 @@ tests:
209209
path: spec.template.spec.runtimeClassName
210210
value: myClass
211211

212-
- it: should create a DaemonSet with the electionID label on the pod template when leader election is enabled
212+
- it: should create a DaemonSet with election ID label
213213
set:
214214
controller.kind: DaemonSet
215215
controller.disableLeaderElection: false
216216
asserts:
217217
- equal:
218-
path: spec.template.metadata.labels['nginx.ingress.kubernetes.io/electionID']
218+
path: spec.template.metadata.labels["nginx.ingress.kubernetes.io/election-id"]
219219
value: RELEASE-NAME-ingress-nginx-leader
220220

221-
- it: should create a DaemonSet with the custom electionID label on the pod template when controller.electionID is set and leader election is enabled
221+
- it: should create a DaemonSet with custom election ID label if `controller.electionID` is set
222222
set:
223223
controller.kind: DaemonSet
224224
controller.disableLeaderElection: false
225225
controller.electionID: custom-election-id
226226
asserts:
227227
- equal:
228-
path: spec.template.metadata.labels['nginx.ingress.kubernetes.io/electionID']
228+
path: spec.template.metadata.labels["nginx.ingress.kubernetes.io/election-id"]
229229
value: custom-election-id
230230

231-
- it: should create a DaemonSet without the electionID label on the pod template when leader election is disabled
231+
- it: should create a DaemonSet without election ID label if `controller.disableLeaderElection` is true
232232
set:
233233
controller.kind: DaemonSet
234234
controller.disableLeaderElection: true
235235
asserts:
236236
- notExists:
237-
path: spec.template.metadata.labels['nginx.ingress.kubernetes.io/electionID']
237+
path: spec.template.metadata.labels["nginx.ingress.kubernetes.io/election-id"]

0 commit comments

Comments
 (0)