Skip to content

Commit 1059821

Browse files
authored
Merge pull request #4639 from vincepri/fix-e2e-vp2
🐛 Fix race condition between cluster delete, and check
2 parents b003e69 + 70d9a76 commit 1059821

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/e2e/suites/unmanaged/unmanaged_functional_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/onsi/ginkgo/v2"
3434
. "github.com/onsi/gomega"
3535
corev1 "k8s.io/api/core/v1"
36+
apierrors "k8s.io/apimachinery/pkg/api/errors"
3637
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3738
"k8s.io/utils/pointer"
3839
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -1087,6 +1088,10 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
10871088
ginkgo.By("Waiting for AWSCluster to show the VPC endpoint as deleted in conditions")
10881089
Eventually(func() bool {
10891090
awsCluster, err := GetAWSClusterByName(ctx, namespace.Name, clusterName)
1091+
// If the cluster was already deleted, we can ignore the error.
1092+
if apierrors.IsNotFound(err) {
1093+
return true
1094+
}
10901095
Expect(err).To(BeNil())
10911096
return conditions.IsFalse(awsCluster, infrav1.VpcEndpointsReadyCondition) &&
10921097
conditions.GetReason(awsCluster, infrav1.VpcEndpointsReadyCondition) == clusterv1.DeletedReason

0 commit comments

Comments
 (0)