Skip to content

Commit

Permalink
feat: allow setting permanent on redirectTo
Browse files Browse the repository at this point in the history
  • Loading branch information
berlincount authored Jun 12, 2024
1 parent 4f0b81a commit 1b454e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@
{{- if $config.redirectTo.priority }}
- "--entryPoints.{{ $entrypoint }}.http.redirections.entryPoint.priority={{ $config.redirectTo.priority }}"
{{- end }}
{{- if $config.redirectTo.permanent }}
- "--entryPoints.{{ $entrypoint }}.http.redirections.entryPoint.permanent=true"
{{- end }}
{{- end }}
{{- if $config.middlewares }}
- "--entryPoints.{{ $entrypoint }}.http.middlewares={{ join "," $config.middlewares }}"
Expand Down
13 changes: 13 additions & 0 deletions traefik/tests/deployment-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,16 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: "--entryPoints.web.http.redirections.entryPoint.priority=10"
- it: should have permanent http redirections enabled, when enabled with redirectTo and permanent
set:
ports:
web:
redirectTo:
port: websecure
permanent: true
websecure:
exposedPort: 443
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--entryPoints.web.http.redirections.entryPoint.permanent=true"
1 change: 1 addition & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ ports:
# port: websecure
# (Optional)
# priority: 10
# permanent: true
#
# -- Trust forwarded headers information (X-Forwarded-*).
# forwardedHeaders:
Expand Down

0 comments on commit 1b454e9

Please sign in to comment.