Skip to content

Commit

Permalink
Merge pull request #4636 from vincepri/fix-e2e-vp
Browse files Browse the repository at this point in the history
🐛 e2e should delete the cluster before validating
  • Loading branch information
k8s-ci-robot authored Nov 15, 2023
2 parents 82b9314 + 8c03bf6 commit f9ac237
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/e2e/suites/unmanaged/unmanaged_functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
awsCluster, err := GetAWSClusterByName(ctx, namespace.Name, clusterName)
Expect(err).To(BeNil())

// Validate that s3 endpoints were created in the vpc.
ginkgo.By("Validating the s3 endpoint was created")
vpc, err := shared.GetVPCByName(e2eCtx, clusterName+"-vpc")
Expect(err).NotTo(HaveOccurred())
Expect(vpc).NotTo(BeNil())
Expand All @@ -1081,16 +1081,16 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
Expect(*endpoints[0].ServiceName).To(Equal("com.amazonaws." + awsCluster.Spec.Region + ".s3"))
Expect(*endpoints[0].VpcId).To(Equal(*vpc.VpcId))

ginkgo.By("Deleting the cluster")
deleteCluster(ctx, cluster)

ginkgo.By("Waiting for AWSCluster to show the VPC endpoint as deleted in conditions")
Eventually(func() bool {
awsCluster, err := GetAWSClusterByName(ctx, namespace.Name, clusterName)
Expect(err).To(BeNil())
return conditions.IsFalse(awsCluster, infrav1.VpcEndpointsReadyCondition) &&
conditions.GetReason(awsCluster, infrav1.VpcEndpointsReadyCondition) == clusterv1.DeletedReason
}, e2eCtx.E2EConfig.GetIntervals("", "wait-delete-cluster")...).Should(BeTrue())

ginkgo.By("Deleting the cluster")
deleteCluster(ctx, cluster)
})
})
})
Expand Down

0 comments on commit f9ac237

Please sign in to comment.