Skip to content

Commit

Permalink
tests: fix helm upgrade test by checking DataPlane's deployment not t…
Browse files Browse the repository at this point in the history
…he DataPlane itself
  • Loading branch information
pmalek committed Oct 3, 2024
1 parent 7c36159 commit 1fa54cf
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions test/e2e/test_helm_install_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,30 @@ func gatewayDataPlaneDeploymentIsNotPatched(gatewayLabelSelector string) func(co
if !assert.Len(c, dataplanes, 1) {
return
}
dp := &dataplanes[0]
if dp.Generation != 1 {
c.Errorf("DataPlane %q got patched but it shouldn't: %v", client.ObjectKeyFromObject(dp), err)

dataplane := &dataplanes[0]
deployments, err := k8sutils.ListDeploymentsForOwner(
ctx,
cl,
dataplane.Namespace,
dataplane.UID,
client.MatchingLabels{
"app": dataplane.Name,
},
)
if !assert.NoError(c, err) {
return
}

if !assert.Len(c, deployments, 1) {
return
}

deployment := &deployments[0]
if deployment.Generation != 1 {
c.Errorf("DataPlane %q Deployment %q got patched but it shouldn't: %v",
client.ObjectKeyFromObject(dataplane), client.ObjectKeyFromObject(deployment), err,
)
return
}
}
Expand Down

0 comments on commit 1fa54cf

Please sign in to comment.