mirror of https://github.com/docker/docs.git
fix use of x-* attribute in go templates (#22403)
## Description fix https://docs.docker.com/compose/bridge/customize/#add-your-own-templates as attributes with a `-` can't be accessed directly using dot-notation in a go template. See https://stackoverflow.com/questions/48146448/range-through-values-within-variable-containing-dashes-in-golang-templates ## Related issues or tickets ## Reviews - [ ] Technical review - [ ] Editorial review - [ ] Product review Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
b720d48b04
commit
6057a7b51f
|
@ -133,8 +133,8 @@ metadata:
|
|||
spec:
|
||||
rules:
|
||||
{{ range $name, $service := .services }}
|
||||
{{ if $service.x-virtual-host }}
|
||||
- host: ${{ $service.x-virtual-host }}
|
||||
{{ range index $service "x-virtual-host" }}
|
||||
- host: ${{ . }}
|
||||
http:
|
||||
paths:
|
||||
- path: "/"
|
||||
|
|
Loading…
Reference in New Issue