Skip to content

Commit

Permalink
Merge pull request #4639 from vincepri/fix-e2e-vp2
Browse files Browse the repository at this point in the history
🐛 Fix race condition between cluster delete, and check
  • Loading branch information
k8s-ci-robot committed Nov 20, 2023
2 parents b003e69 + 70d9a76 commit 1059821
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/suites/unmanaged/unmanaged_functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -1087,6 +1088,10 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
ginkgo.By("Waiting for AWSCluster to show the VPC endpoint as deleted in conditions")
Eventually(func() bool {
awsCluster, err := GetAWSClusterByName(ctx, namespace.Name, clusterName)
// If the cluster was already deleted, we can ignore the error.
if apierrors.IsNotFound(err) {
return true
}
Expect(err).To(BeNil())
return conditions.IsFalse(awsCluster, infrav1.VpcEndpointsReadyCondition) &&
conditions.GetReason(awsCluster, infrav1.VpcEndpointsReadyCondition) == clusterv1.DeletedReason
Expand Down

0 comments on commit 1059821

Please sign in to comment.