mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 09:48:14 +00:00
fix: limit exposed ports in template comment to 10 (#2494)
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
This commit is contained in:
parent
290d275a68
commit
c5f054ed36
@ -125,7 +125,7 @@
|
|||||||
*/}}
|
*/}}
|
||||||
{{- define "container_port" }}
|
{{- define "container_port" }}
|
||||||
{{- /* If only 1 port exposed, use that as a default, else 80. */}}
|
{{- /* 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 (first ten):{{ range $index, $address := (sortObjectsByKeysAsc $.container.Addresses "Port") }}{{ if lt $index 10 }} {{ $address.Port }}/{{ $address.Proto }}{{ end }}{{ else }} (none){{ end }}
|
||||||
{{- $default_port := when (eq (len $.container.Addresses) 1) (first $.container.Addresses).Port "80" }}
|
{{- $default_port := when (eq (len $.container.Addresses) 1) (first $.container.Addresses).Port "80" }}
|
||||||
# default port: {{ $default_port }}
|
# default port: {{ $default_port }}
|
||||||
{{- $port := when (eq $.port "default") $default_port (when (eq $.port "legacy") (or $.container.Env.VIRTUAL_PORT $default_port) $.port) }}
|
{{- $port := when (eq $.port "default") $default_port (when (eq $.port "legacy") (or $.container.Env.VIRTUAL_PORT $default_port) $.port) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user