From bc8a731e28ccf33ece598cf2e793692176538cf5 Mon Sep 17 00:00:00 2001 From: Mahnoor Mehboob Date: Mon, 26 Apr 2021 17:32:50 -0400 Subject: [PATCH] reset backend and disableCatchAll to og value --- internal/ingress/controller/controller_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/ingress/controller/controller_test.go b/internal/ingress/controller/controller_test.go index c5b29ba8c..a7560c3bf 100644 --- a/internal/ingress/controller/controller_test.go +++ b/internal/ingress/controller/controller_test.go @@ -257,6 +257,9 @@ func TestCheckIngress(t *testing.T) { }) t.Run("When a new catch-all ingress is being created despite catch-alls being disabled ", func(t *testing.T) { + backendBefore := ing.Spec.Backend + disableCatchAllBefore := nginx.cfg.DisableCatchAll + nginx.command = testNginxTestCommand{ t: t, err: nil, @@ -274,8 +277,9 @@ func TestCheckIngress(t *testing.T) { t.Errorf("with a new catch-all ingress and catch-alls disable, should return error") } - // set back to nil for next test - ing.Spec.Backend = nil + // reset backend and catch-all flag + ing.Spec.Backend = backendBefore + nginx.cfg.DisableCatchAll = disableCatchAllBefore }) t.Run("When the ingress is in a different namespace than the watched one", func(t *testing.T) {