Skip to content

Commit

Permalink
restart Envoy pods in between E2E tests
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kriss <[email protected]>
  • Loading branch information
skriss committed Mar 5, 2024
1 parent 4a0e5dd commit c0891fc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/httpproxy/httpproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions test/e2e/infra/infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c0891fc

Please sign in to comment.