Skip to content

Commit

Permalink
test/e2e: wait for Contour deployment to update before upgrading Envoy (
Browse files Browse the repository at this point in the history
#5373)

This alters the upgrade test to wait for the Contour
deployment to finish upgrading before rolling out
the Envoy upgrade. This is inline with what we have
documented as the upgrade procedure, and looks like
it helps with the request failures that we've been
seeing.

Updates #4991.

Signed-off-by: Steve Kriss <krisss@vmware.com>
  • Loading branch information
skriss authored May 18, 2023
1 parent 17fe665 commit 0b4a8b8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 0 additions & 2 deletions test/e2e/bench/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ var _ = BeforeSuite(func() {
)

require.NoError(f.T(), f.Deployment.EnsureResourcesForInclusterContour(true))
require.NoError(f.T(), f.Deployment.WaitForContourDeploymentUpdated())
require.NoError(f.T(), f.Deployment.WaitForEnvoyUpdated())

require.Eventually(f.T(), func() bool {
s := &corev1.Service{}
Expand Down
22 changes: 19 additions & 3 deletions test/e2e/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ func (d *Deployment) EnsureResourcesForInclusterContour(startContourDeployment b
if err := d.EnsureContourDeployment(); err != nil {
return err
}

if err := d.WaitForContourDeploymentUpdated(); err != nil {
return err
}
}

var envoyPodSpec *v1.PodSpec
Expand Down Expand Up @@ -904,11 +908,23 @@ func (d *Deployment) EnsureResourcesForInclusterContour(startContourDeployment b
// node, so scale the deployment to 1.
d.EnvoyDeployment.Spec.Replicas = ref.To(int32(1))

return d.EnsureEnvoyDeployment()
if err := d.EnsureEnvoyDeployment(); err != nil {
return err
}
} else {
// Otherwise, we're deploying Envoy as a DaemonSet.
if err := d.EnsureEnvoyDaemonSet(); err != nil {
return err
}
}

if startContourDeployment {
// Envoys will only be ready if Contour
// has started.
return d.WaitForEnvoyUpdated()
}

// Otherwise, we're deploying Envoy as a DaemonSet.
return d.EnsureEnvoyDaemonSet()
return nil
}

// DeleteResourcesForInclusterContour ensures deletion of all resources
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ var _ = Describe("upgrading Contour", func() {
By("deploying updated contour resources")
require.NoError(f.T(), f.Deployment.EnsureResourcesForInclusterContour(true))

By("waiting for contour deployment to be updated")
require.NoError(f.T(), f.Deployment.WaitForContourDeploymentUpdated())

By("waiting for envoy daemonset to be updated")
require.NoError(f.T(), f.Deployment.WaitForEnvoyUpdated())

By("ensuring app is still routable")
checkRoutability(appHost)

Expand Down

0 comments on commit 0b4a8b8

Please sign in to comment.