Skip to content

Commit

Permalink
fix(KubernetesCRD): šŸ› IngressClass should be readable even when kuberā€¦
Browse files Browse the repository at this point in the history
ā€¦netesIngress is disabled
  • Loading branch information
mloiseleur authored Nov 7, 2024
1 parent 18fcb8c commit 30012c0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions traefik/templates/rbac/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ rules:
- update
{{- end -}}
{{- if .Values.providers.kubernetesCRD.enabled }}
{{- if not .Values.providers.kubernetesIngress.enabled }}
- apiGroups:
- extensions
- networking.k8s.io
resources:
- ingressclasses
verbs:
- get
- list
- watch
{{- end }}
- apiGroups:
- traefik.io
resources:
Expand Down
19 changes: 19 additions & 0 deletions traefik/tests/rbac-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ tests:
verbs:
- update
template: rbac/clusterrole.yaml
- it: ClusterRole should be able to read ingressclass when only kubernetesCRD is enabled
set:
providers:
kubernetesIngress:
enabled: false
asserts:
- contains:
path: rules
content:
apiGroups:
- extensions
- networking.k8s.io
resources:
- ingressclasses
verbs:
- get
- list
- watch
template: rbac/clusterrole.yaml
- it: ClusterRole should not be able to read CRDs when kubernetesCRD is disabled
set:
providers:
Expand Down

0 comments on commit 30012c0

Please sign in to comment.