Skip to content

Commit

Permalink
feat: allow update of namespace policy for websecure listener
Browse files Browse the repository at this point in the history
  • Loading branch information
renebarbosafl committed Nov 6, 2023
1 parent 8971ce1 commit 2045843
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions traefik/templates/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ spec:
- name: websecure
port: {{ $.Values.ports.websecure.port }}
protocol: HTTPS
{{- with .Values.experimental.kubernetesGateway.namespacePolicy }}
allowedRoutes:
namespaces:
from: {{ . }}
{{- end }}
tls:
certificateRefs:
- name: {{ .Values.experimental.kubernetesGateway.certificate.name }}
Expand Down
16 changes: 15 additions & 1 deletion traefik/tests/gateway-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tests:
- equal:
path: metadata.namespace
value: "NAMESPACE"
- it: should configure allowedRoutes within web listener
- it: should configure namespacePolicy within web listener
set:
experimental:
kubernetesGateway:
Expand All @@ -27,6 +27,20 @@ tests:
- equal:
path: spec.listeners[0].allowedRoutes.namespaces.from
value: "All"
- it: should configure namespacePolicy within websecure listener
set:
experimental:
kubernetesGateway:
enabled: true
namespacePolicy: All
certificate:
group: "core"
kind: "Secret"
name: "mysecret"
asserts:
- equal:
path: spec.listeners[1].allowedRoutes.namespaces.from
value: "All"
- it: should have one Gateway with the correct class and an http port as well as an https port
set:
experimental:
Expand Down

0 comments on commit 2045843

Please sign in to comment.