Skip to content

Commit

Permalink
fix: support uppercase letters in entrypoint names
Browse files Browse the repository at this point in the history
Traefik supports entrypoints with uppercase letters (e.g. webSecure),
but helm generated manifest fails to apply because port names can only be lowercase.

This forces lower case on port names for entrypoints.
  • Loading branch information
uvNikita committed Dec 17, 2024
1 parent acd4405 commit fdc4de7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
{{- fail "ERROR: All hostPort must match their respective containerPort when `hostNetwork` is enabled" }}
{{- end }}
{{- end }}
- name: {{ $name | quote }}
- name: {{ $name | lower | quote }}
containerPort: {{ default $config.port $config.containerPort }}
{{- if $config.hostPort }}
hostPort: {{ $config.hostPort }}
Expand Down
13 changes: 13 additions & 0 deletions traefik/tests/ports-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,16 @@ tests:
asserts:
- failedTemplate:
errorMessage: "ERROR: Cannot create ssh port on Service without .port or .exposedPort"
- it: should support uppercase letters in entrypoint names
set:
ports:
UPPERCASE:
port: 443
asserts:
- contains:
path: spec.template.spec.containers[0].ports
content:
name: uppercase
containerPort: 443
protocol: TCP
template: deployment.yaml

0 comments on commit fdc4de7

Please sign in to comment.