diff --git a/test/e2e/deployment.go b/test/e2e/deployment.go index 6383c78e8f9..d9f6be0f61d 100644 --- a/test/e2e/deployment.go +++ b/test/e2e/deployment.go @@ -369,6 +369,10 @@ func (d *Deployment) EnsureEnvoyDeployment() error { return d.ensureResource(d.EnvoyDeployment, new(apps_v1.Deployment)) } +func (d *Deployment) RestartEnvoy() error { + return d.client.DeleteAllOf(context.Background(), &core_v1.Pod{}, client.InNamespace(d.Namespace.Name), client.MatchingLabels{"app": "envoy"}) +} + func (d *Deployment) WaitForEnvoyUpdated() error { if d.EnvoyDeploymentMode == DaemonsetMode { return WaitForEnvoyDaemonSetUpdated(d.EnvoyDaemonSet, d.client, d.contourImage) diff --git a/test/e2e/gateway/gateway_test.go b/test/e2e/gateway/gateway_test.go index c0287e53279..63ef38f15db 100644 --- a/test/e2e/gateway/gateway_test.go +++ b/test/e2e/gateway/gateway_test.go @@ -141,6 +141,7 @@ var _ = Describe("Gateway API", func() { AfterEach(func() { require.NoError(f.T(), f.DeleteGatewayClass(contourGatewayClass, false)) require.NoError(f.T(), f.Deployment.StopLocalContour(contourCmd, contourConfigFile)) + require.NoError(f.T(), f.Deployment.RestartEnvoy()) }) Describe("Gateway with one HTTP listener", func() { diff --git a/test/e2e/httpproxy/httpproxy_test.go b/test/e2e/httpproxy/httpproxy_test.go index ff01a0af897..21b63c6f6b5 100644 --- a/test/e2e/httpproxy/httpproxy_test.go +++ b/test/e2e/httpproxy/httpproxy_test.go @@ -106,6 +106,7 @@ var _ = Describe("HTTPProxy", func() { AfterEach(func() { require.NoError(f.T(), f.Deployment.StopLocalContour(contourCmd, contourConfigFile)) + require.NoError(f.T(), f.Deployment.RestartEnvoy()) }) f.NamespacedTest("httpproxy-direct-response-policy", testDirectResponseRule) diff --git a/test/e2e/infra/infra_test.go b/test/e2e/infra/infra_test.go index d18ea99c234..cfe08807a98 100644 --- a/test/e2e/infra/infra_test.go +++ b/test/e2e/infra/infra_test.go @@ -121,6 +121,7 @@ var _ = Describe("Infra", func() { AfterEach(func() { f.Kubectl.StopKubectlPortForward(kubectlCmd) require.NoError(f.T(), f.Deployment.StopLocalContour(contourCmd, contourConfigFile)) + require.NoError(f.T(), f.Deployment.RestartEnvoy()) }) f.Test(testMetrics) diff --git a/test/e2e/ingress/ingress_test.go b/test/e2e/ingress/ingress_test.go index 0e48a3cf481..89c8990c317 100644 --- a/test/e2e/ingress/ingress_test.go +++ b/test/e2e/ingress/ingress_test.go @@ -88,6 +88,7 @@ var _ = Describe("Ingress", func() { AfterEach(func() { require.NoError(f.T(), f.Deployment.StopLocalContour(contourCmd, contourConfigFile)) + require.NoError(f.T(), f.Deployment.RestartEnvoy()) }) f.NamespacedTest("ingress-tls-wildcard-host", testTLSWildcardHost)