diff --git a/test/e2e/annotations/affinity.go b/test/e2e/annotations/affinity.go index 83ad03ecf..f3ddc8928 100644 --- a/test/e2e/annotations/affinity.go +++ b/test/e2e/annotations/affinity.go @@ -32,11 +32,15 @@ import ( "k8s.io/ingress-nginx/test/e2e/framework" ) +// TODO(elvinefendi) merge this with Affinity tests in test/e2e/lua/dynamic_configuration.go var _ = framework.IngressNginxDescribe("Annotations - Affinity", func() { f := framework.NewDefaultFramework("affinity") BeforeEach(func() { - err := f.NewEchoDeploymentWithReplicas(2) + err := f.DisableDynamicConfiguration() + Expect(err).NotTo(HaveOccurred()) + + err = f.NewEchoDeploymentWithReplicas(2) Expect(err).NotTo(HaveOccurred()) }) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index e530777da..6ae692bbf 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -420,3 +420,19 @@ func NewSingleIngress(name, path, host, ns, service string, port int, annotation return ing } + +// DisableDynamicConfiguration disables dynamic configuration +func (f *Framework) DisableDynamicConfiguration() error { + return UpdateDeployment(f.KubeClientSet, f.IngressController.Namespace, "nginx-ingress-controller", 1, + func(deployment *appsv1beta1.Deployment) error { + args := deployment.Spec.Template.Spec.Containers[0].Args + args = append(args, "--enable-dynamic-configuration=false") + deployment.Spec.Template.Spec.Containers[0].Args = args + _, err := f.KubeClientSet.AppsV1beta1().Deployments(f.IngressController.Namespace).Update(deployment) + if err != nil { + return err + } + + return nil + }) +}