Skip to content

Commit

Permalink
fix(Gateway API): status should not use default service when it's dis…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
mloiseleur committed Jan 9, 2025
1 parent c6a991d commit 30ecff6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions traefik/tests/traefik-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,28 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesingress.ingressendpoint.publishedservice=foo/bar"
- it: should not set default publishedService when service is disabled
set:
service:
enabled: false
asserts:
- notContains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesingress.ingressendpoint.publishedservice=NAMESPACE/RELEASE-NAME-traefik"
- it: should not set default statusAddress when service is disabled
set:
service:
enabled: false
providers:
kubernetesGateway:
enabled: true
asserts:
- notContains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesgateway.statusaddress.service.name=RELEASE-NAME-traefik"
- notContains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesgateway.statusaddress.service.namespace=NAMESPACE"
- it: should be possible to set statusAddress fields
set:
providers:
Expand Down
4 changes: 2 additions & 2 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ providers: # @schema additionalProperties: false
hostname: ""
# -- The Kubernetes service to copy status addresses from. When using third parties tools like External-DNS, this option can be used to copy the service loadbalancer.status (containing the service's endpoints IPs) to the gateways. Default to Service of this Chart.
service:
name: "{{ (include \"traefik.fullname\" .) }}"
namespace: "{{ include \"traefik.namespace\" . }}"
name: "{{ .Values.service.enabled | ternary (include \"traefik.fullname\" .) nil }}"
namespace: "{{ .Values.service.enabled | ternary (include \"traefik.namespace\" .) nil }}"

file:
# -- Create a file provider
Expand Down

0 comments on commit 30ecff6

Please sign in to comment.