Update lua configuration_data when number of controller pod change

This commit is contained in:
Maxime Ginters 2018-11-27 09:53:51 -05:00
parent 55b4f00368
commit f90881b367
10 changed files with 113 additions and 19 deletions

View file

@ -149,6 +149,20 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() {
})
Expect(nginxConfig).ShouldNot(Equal(newNginxConfig))
})
It("sets controllerPodsCount in Lua general configuration", func() {
output, err := f.ExecIngressPod("curl --fail --silent http://127.0.0.1:18080/configuration/general")
Expect(err).ToNot(HaveOccurred())
Expect(output).Should(Equal(`{"controllerPodsCount":1}`))
err = framework.UpdateDeployment(f.KubeClientSet, f.IngressController.Namespace, "nginx-ingress-controller", 3, nil)
Expect(err).ToNot(HaveOccurred())
time.Sleep(waitForLuaSync)
output, err = f.ExecIngressPod("curl --fail --silent http://127.0.0.1:18080/configuration/general")
Expect(err).ToNot(HaveOccurred())
Expect(output).Should(Equal(`{"controllerPodsCount":3}`))
})
})
func ensureIngress(f *framework.Framework, host string) *extensions.Ingress {