Limit exposed ports in template to 10
This commit is contained in:
parent
8d47458026
commit
bce9576b88
1 changed files with 2 additions and 2 deletions
|
@ -125,7 +125,7 @@
|
|||
*/}}
|
||||
{{- define "container_port" }}
|
||||
{{- /* If only 1 port exposed, use that as a default, else 80. */}}
|
||||
# exposed ports:{{ range sortObjectsByKeysAsc $.container.Addresses "Port" }} {{ .Port }}/{{ .Proto }}{{ else }} (none){{ end }}
|
||||
# exposed ports:{{ $maxPorts := 10 }}{{ $count := 0 }}{{ range sortObjectsByKeysAsc $.container.Addresses "Port" }}{{ if lt $count $maxPorts }} {{ .Port }}/{{ .Proto }}{{ $count = add $count 1 }}{{ end }}{{ else }} (none){{ end }}
|
||||
{{- $default_port := when (eq (len $.container.Addresses) 1) (first $.container.Addresses).Port "80" }}
|
||||
# default port: {{ $default_port }}
|
||||
{{- $port := when (eq $.port "default") $default_port (when (eq $.port "legacy") (or $.container.Env.VIRTUAL_PORT $default_port) $.port) }}
|
||||
|
|
Loading…
Reference in a new issue