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

feat: allow update of namespace policy for websecure listener #949

Merged
merged 1 commit into from
Nov 6, 2023
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
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