clean backends data before sending to Lua endpoint (#2233)
This commit is contained in:
parent
39b7d97fd5
commit
4fe4a61ecb
1 changed files with 9 additions and 1 deletions
|
@ -763,7 +763,15 @@ func (n *NGINXController) IsDynamicallyConfigurable(pcfg *ingress.Configuration)
|
||||||
// ConfigureDynamically JSON encodes new Backends and POSTs it to an internal HTTP endpoint
|
// ConfigureDynamically JSON encodes new Backends and POSTs it to an internal HTTP endpoint
|
||||||
// that is handled by Lua
|
// that is handled by Lua
|
||||||
func (n *NGINXController) ConfigureDynamically(pcfg *ingress.Configuration) error {
|
func (n *NGINXController) ConfigureDynamically(pcfg *ingress.Configuration) error {
|
||||||
buf, err := json.Marshal(pcfg.Backends)
|
backends := make([]*ingress.Backend, len(pcfg.Backends))
|
||||||
|
|
||||||
|
for i, backend := range pcfg.Backends {
|
||||||
|
cleanedupBackend := *backend
|
||||||
|
cleanedupBackend.Service = nil
|
||||||
|
backends[i] = &cleanedupBackend
|
||||||
|
}
|
||||||
|
|
||||||
|
buf, err := json.Marshal(backends)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue