Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Traefik Proxy): allowEmptyServices not disabled when set to false #1256

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,10 @@
{{- if .Values.providers.kubernetesCRD.allowExternalNameServices }}
- "--providers.kubernetescrd.allowExternalNameServices=true"
{{- end }}
{{- if .Values.providers.kubernetesCRD.allowEmptyServices }}
- "--providers.kubernetescrd.allowEmptyServices=true"
{{- if ne .Values.providers.kubernetesCRD.allowEmptyServices nil }}
{{- with .Values.providers.kubernetesCRD.allowEmptyServices | toString }}
- "--providers.kubernetescrd.allowEmptyServices={{ . }}"
{{- end }}
{{- end }}
{{- if and .Values.rbac.namespaced (semverCompare ">=3.1.2-0" $version) }}
- "--providers.kubernetescrd.disableClusterScopeResources=true"
Expand All @@ -477,8 +479,10 @@
{{- if .Values.providers.kubernetesIngress.allowExternalNameServices }}
- "--providers.kubernetesingress.allowExternalNameServices=true"
{{- end }}
{{- if .Values.providers.kubernetesIngress.allowEmptyServices }}
- "--providers.kubernetesingress.allowEmptyServices=true"
{{- if ne .Values.providers.kubernetesIngress.allowEmptyServices nil }}
{{- with .Values.providers.kubernetesIngress.allowEmptyServices | toString }}
- "--providers.kubernetesingress.allowEmptyServices={{ . }}"
{{- end }}
{{- end }}
{{- if and .Values.service.enabled .Values.providers.kubernetesIngress.publishedService.enabled }}
- "--providers.kubernetesingress.ingressendpoint.publishedservice={{ template "providers.kubernetesIngress.publishedServicePath" . }}"
Expand Down
38 changes: 37 additions & 1 deletion traefik/tests/pod-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ tests:
asserts:
- isNull:
path: spec.template.spec.containers[0].runtimeClassName
- it: should set runtimeClassName when configured
- it: should set defaultRuleSyntax when configured
set:
core:
defaultRuleSyntax: v2
Expand Down Expand Up @@ -709,3 +709,39 @@ tests:
asserts:
- failedTemplate:
errorPattern: "level"
- it: should set allowEmptyServices for kubernetesCRD
set:
providers:
kubernetesCRD:
allowEmptyServices: true
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetescrd.allowEmptyServices=true"
- it: should unset allowEmptyServices for kubernetesCRD
set:
providers:
kubernetesCRD:
allowEmptyServices: false
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetescrd.allowEmptyServices=false"
- it: should set allowEmptyServices for kubernetesIngress
set:
providers:
kubernetesIngress:
allowEmptyServices: true
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesingress.allowEmptyServices=true"
- it: should unset allowEmptyServices for kubernetesIngress
set:
providers:
kubernetesIngress:
allowEmptyServices: false
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--providers.kubernetesingress.allowEmptyServices=false"