Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
fix: compile nginx template
Browse files Browse the repository at this point in the history
  • Loading branch information
eliobischof committed Dec 11, 2019
1 parent 0567f51 commit 99e13fc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions internal/kinds/loadbalancers/dynamic/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,15 @@ vrrp_instance VI_{{ $idx }} {
`))

nginxTemplate := template.Must(template.New("").Funcs(templateFuncs).Parse(`{{ $root := . }}stream { {{ range $vip := .VIPs }}{{ range $src := $vip.Transport }}
upstream {{ $src.Name }} { {{ range $dest := $src.Destinations }}{{ range $compute := computes $dest.Pool }}
server {{ $compute.InternalIP }}:{{ $dest.Port }}; # {{ $dest.Pool }}{{end}}{{ end }}
}
server {
listen {{ $vip.IP }}:{{ $src.SourcePort }};
proxy_pass {{ $src.Name }};
}
{{ end }}{{ end }}}`))
upstream {{ $src.Name }} { {{ range $dest := $src.Destinations }}{{ range $compute := computes $dest.Pool true }}
server {{ $compute.InternalIP }}:{{ $dest.Port }}; # {{ $dest.Pool }}{{end}}{{ end }}
}
server {
listen {{ $vip.IP }}:{{ $src.SourcePort }};
proxy_pass {{ $src.Name }};
}
{{ end }}{{ end }}}
`))

var wg sync.WaitGroup
synchronizer := helpers.NewSynchronizer(&wg)
Expand Down

0 comments on commit 99e13fc

Please sign in to comment.