This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-09-27 10:49:45 -03:00
parent 29ea30a4e8
commit a767b1d906
13 changed files with 17 additions and 270 deletions

View file

@ -828,9 +828,6 @@ func (n *NGINXController) IsDynamicConfigurationEnough(pcfg *ingress.Configurati
clearL4serviceEndpoints(&copyOfRunningConfig)
clearL4serviceEndpoints(&copyOfPcfg)
copyOfRunningConfig.ControllerPodsCount = 0
copyOfPcfg.ControllerPodsCount = 0
clearCertificates(&copyOfRunningConfig)
clearCertificates(&copyOfPcfg)
@ -856,18 +853,6 @@ func (n *NGINXController) configureDynamically(pcfg *ingress.Configuration) erro
}
}
if n.runningConfig.ControllerPodsCount != pcfg.ControllerPodsCount {
statusCode, _, err := nginx.NewPostStatusRequest("/configuration/general", "application/json", ingress.GeneralConfig{
ControllerPodsCount: pcfg.ControllerPodsCount,
})
if err != nil {
return err
}
if statusCode != http.StatusCreated {
return fmt.Errorf("unexpected error code: %d", statusCode)
}
}
serversChanged := !reflect.DeepEqual(n.runningConfig.Servers, pcfg.Servers)
if serversChanged {
err := configureCertificates(pcfg.Servers)