common/templates/traefik_middlewares

13 lines
446 B
HCL

[[- /*
# vim: syntax=hcl
# Note: for compatibility, we take traefik either from .traefik (when passing the whole context to the template)
# or from . (when only .traefik is passed as context)
*/ -]]
[[- $traefik := dict ]]
[[- if and (has . "traefik") (isKind "map" .traefik) ]]
[[- $traefik = .traefik ]]
[[- else ]]
[[- $traefik = . ]]
[[- end -]]
[[- join (coll.Flatten (coll.Slice $traefik.base_middlewares $traefik.middlewares)) "," -]]