Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko authored Jan 17, 2025
1 parent cc2ffd3 commit 7097f5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 49 deletions.
27 changes: 1 addition & 26 deletions charts/ingress-nginx/tests/controller-service-internal_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,14 @@ tests:
path: spec.trafficDistribution
value: PreferClose

- it: should create a Service with custom labels if `controller.service.internal.labels` is set
- it: should create a Service with labels if `controller.service.internal.labels` is set
set:
controller.service.internal.enabled: true
controller.service.internal.annotations:
test.annotation: "true"
controller.service.internal.labels:
external-dns.alpha.kubernetes.io/hostname: internal.example.com
asserts:
- hasDocuments:
count: 1
- isKind:
of: Service
- equal:
path: metadata.labels.external-dns\.alpha\.kubernetes\.io/hostname
value: internal.example.com

- it: should merge service labels with internal labels maintaining backward compatibility
set:
controller.service.internal.enabled: true
controller.service.internal.annotations:
test.annotation: "true"
controller.service.labels:
global-service: "true"
controller.service.internal.labels:
internal-specific: "true"
asserts:
- hasDocuments:
count: 1
- isKind:
of: Service
- equal:
path: metadata.labels.global-service
value: "true"
- equal:
path: metadata.labels.internal-specific
value: "true"
27 changes: 4 additions & 23 deletions charts/ingress-nginx/tests/controller-service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,16 @@ tests:
path: spec.trafficDistribution
value: PreferClose

- it: should create a Service with custom external labels if `controller.service.external.labels` is set
- it: should create a Service with labels if `controller.service.external.labels` is set
set:
controller.service.external.enabled: true
controller.service.external.labels:
custom-external: test-value
external-dns.alpha.kubernetes.io/hostname: external.example.com
asserts:
- hasDocuments:
count: 1
- isKind:
of: Service
- equal:
path: metadata.labels.custom-external
value: test-value

- it: should merge service labels with external labels maintaining backward compatibility
set:
controller.service.external.enabled: true
controller.service.labels:
global-service: "true"
controller.service.external.labels:
external-specific: "true"
asserts:
- hasDocuments:
count: 1
- isKind:
of: Service
- equal:
path: metadats.labels.global-service
value: "true"
- equal:
path: metadata.labels.external-specific
value: "true"
path: metadata.labels.external-dns\.alpha\.kubernetes\.io/hostname
value: external.example.com

0 comments on commit 7097f5f

Please sign in to comment.