Skip to content

Commit

Permalink
fix(Gateway API): wildcard support in hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur committed Aug 12, 2024
1 parent ccdb66b commit 93d1717
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion traefik/templates/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
port: {{ .port }}
protocol: {{ .protocol }}
{{- with .hostname }}
hostname: {{ . }}
hostname: {{ . | toYaml }}
{{- end }}
{{- with .namespacePolicy }}
allowedRoutes:
Expand Down
15 changes: 14 additions & 1 deletion traefik/tests/gateway-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ tests:
- equal:
path: spec.listeners[0].protocol
value: TCP
- it: should be possible to set hostname
- it: should be possible to set regular hostname
set:
providers:
kubernetesGateway:
Expand All @@ -193,6 +193,19 @@ tests:
- equal:
path: spec.listeners[0].hostname
value: test.docker.localhost
- it: should be possible to set hostname with wildcard
set:
providers:
kubernetesGateway:
enabled: true
gateway:
listeners:
web:
hostname: "*.docker.localhost"
asserts:
- equal:
path: spec.listeners[0].hostname
value: "*.docker.localhost"
- it: should fail when no listeners are defined
set:
providers:
Expand Down

0 comments on commit 93d1717

Please sign in to comment.