Skip to content

Commit

Permalink
fix: ingressclass name should be customizable (#864)
Browse files Browse the repository at this point in the history
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
Co-authored-by: Rémi BUISSON <remi-buisson@orange.fr>
  • Loading branch information
3 people committed Jul 25, 2023
1 parent 99dfa8e commit 7f0a0fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion traefik/templates/ingressclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
ingressclass.kubernetes.io/is-default-class: {{ .Values.ingressClass.isDefaultClass | quote }}
labels:
{{- include "traefik.labels" . | nindent 4 }}
name: {{ template "traefik.fullname" . }}
name: {{ .Values.ingressClass.name | default (include "traefik.fullname" .) }}
spec:
controller: traefik.io/ingress-controller
{{- end -}}
15 changes: 15 additions & 0 deletions traefik/tests/ingressclass-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,18 @@ tests:
asserts:
- failedTemplate:
errorMessage: "You must use at least Kubernetes v1.16 with this Chart"
- it: should be possible to provide an IngressClass name
capabilities:
majorVersion: 1
minorVersion: 19
set:
ingressClass:
name: nondefaultname
asserts:
- isKind:
of: IngressClass
- isAPIVersion:
of: networking.k8s.io/v1
- equal:
path: metadata.name
value: nondefaultname
1 change: 1 addition & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ podDisruptionBudget:
ingressClass:
enabled: true
isDefaultClass: true
# name: my-custom-class

# Traefik experimental features
experimental:
Expand Down

0 comments on commit 7f0a0fc

Please sign in to comment.