Skip to content

Commit d104d9b

Browse files
authored
Merge pull request #6490 from jackfrancis/test-framework-retryable-errs-2
🌱 more retryable errors in test/framework
2 parents 8728a93 + cc4b2d4 commit d104d9b

12 files changed

+116
-53
lines changed

test/framework/alltypes_helpers.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ func getClusterAPITypes(ctx context.Context, lister Lister) []metav1.TypeMeta {
8181
discoveredTypes := []metav1.TypeMeta{}
8282

8383
crdList := &apiextensionsv1.CustomResourceDefinitionList{}
84-
err := lister.List(ctx, crdList, capiProviderOptions()...)
85-
Expect(err).ToNot(HaveOccurred(), "failed to list CRDs for CAPI providers")
84+
Eventually(func() error {
85+
return lister.List(ctx, crdList, capiProviderOptions()...)
86+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "failed to list CRDs for CAPI providers")
8687

8788
for _, crd := range crdList.Items {
8889
for _, version := range crd.Spec.Versions {

test/framework/cluster_helpers.go

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
. "github.com/onsi/ginkgo"
2424
. "github.com/onsi/gomega"
2525
apierrors "k8s.io/apimachinery/pkg/api/errors"
26+
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2627
"sigs.k8s.io/controller-runtime/pkg/client"
2728

2829
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -40,7 +41,9 @@ type CreateClusterInput struct {
4041
// CreateCluster will create the Cluster and InfraCluster objects.
4142
func CreateCluster(ctx context.Context, input CreateClusterInput, intervals ...interface{}) {
4243
By("creating an InfrastructureCluster resource")
43-
Expect(input.Creator.Create(ctx, input.InfraCluster)).To(Succeed())
44+
Eventually(func() error {
45+
return input.Creator.Create(ctx, input.InfraCluster)
46+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed())
4447

4548
// This call happens in an eventually because of a race condition with the
4649
// webhook server. If the latter isn't fully online then this call will
@@ -64,7 +67,9 @@ type GetAllClustersByNamespaceInput struct {
6467
// GetAllClustersByNamespace returns the list of Cluster object in a namespace.
6568
func GetAllClustersByNamespace(ctx context.Context, input GetAllClustersByNamespaceInput) []*clusterv1.Cluster {
6669
clusterList := &clusterv1.ClusterList{}
67-
Expect(input.Lister.List(ctx, clusterList, client.InNamespace(input.Namespace))).To(Succeed(), "Failed to list clusters in namespace %s", input.Namespace)
70+
Eventually(func() error {
71+
return input.Lister.List(ctx, clusterList, client.InNamespace(input.Namespace))
72+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list clusters in namespace %s", input.Namespace)
6873

6974
clusters := make([]*clusterv1.Cluster, len(clusterList.Items))
7075
for i := range clusterList.Items {
@@ -184,12 +189,15 @@ func DiscoveryAndWaitForCluster(ctx context.Context, input DiscoveryAndWaitForCl
184189
Expect(input.Namespace).ToNot(BeNil(), "Invalid argument. input.Namespace can't be empty when calling DiscoveryAndWaitForCluster")
185190
Expect(input.Name).ToNot(BeNil(), "Invalid argument. input.Name can't be empty when calling DiscoveryAndWaitForCluster")
186191

187-
cluster := GetClusterByName(ctx, GetClusterByNameInput{
188-
Getter: input.Getter,
189-
Name: input.Name,
190-
Namespace: input.Namespace,
191-
})
192-
Expect(cluster).ToNot(BeNil(), "Failed to get the Cluster object")
192+
var cluster *clusterv1.Cluster
193+
Eventually(func() bool {
194+
cluster = GetClusterByName(ctx, GetClusterByNameInput{
195+
Getter: input.Getter,
196+
Name: input.Name,
197+
Namespace: input.Namespace,
198+
})
199+
return cluster != nil
200+
}, retryableOperationTimeout, retryableOperationInterval).Should(BeTrue(), "Failed to get Cluster object %s/%s", input.Namespace, input.Name)
193201

194202
// NOTE: We intentionally return the provisioned Cluster because it also contains
195203
// the reconciled ControlPlane ref and InfrastructureCluster ref when using a ClusterClass.
@@ -226,11 +234,12 @@ func DeleteClusterAndWait(ctx context.Context, input DeleteClusterAndWaitInput,
226234

227235
//TODO: consider if to move in another func (what if there are more than one cluster?)
228236
log.Logf("Check for all the Cluster API resources being deleted")
229-
resources := GetCAPIResources(ctx, GetCAPIResourcesInput{
230-
Lister: input.Client,
231-
Namespace: input.Cluster.Namespace,
232-
})
233-
Expect(resources).To(BeEmpty(), "There are still Cluster API resources in the %q namespace", input.Cluster.Namespace)
237+
Eventually(func() []*unstructured.Unstructured {
238+
return GetCAPIResources(ctx, GetCAPIResourcesInput{
239+
Lister: input.Client,
240+
Namespace: input.Cluster.Namespace,
241+
})
242+
}, retryableOperationTimeout, retryableOperationInterval).Should(BeEmpty(), "There are still Cluster API resources in the %q namespace", input.Cluster.Namespace)
234243
}
235244

236245
// DeleteAllClustersAndWaitInput is the input type for DeleteAllClustersAndWait.

test/framework/cluster_proxy.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,12 @@ func (p *clusterProxy) CollectWorkloadClusterLogs(ctx context.Context, namespace
248248
return
249249
}
250250

251-
machines, err := getMachinesInCluster(ctx, p.GetClient(), namespace, name)
252-
Expect(err).ToNot(HaveOccurred(), "Failed to get machines for the %s/%s cluster", namespace, name)
251+
var machines *clusterv1.MachineList
252+
Eventually(func() error {
253+
var err error
254+
machines, err = getMachinesInCluster(ctx, p.GetClient(), namespace, name)
255+
return err
256+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to get machines for the %s/%s cluster", namespace, name)
253257

254258
for i := range machines.Items {
255259
m := &machines.Items[i]
@@ -260,8 +264,12 @@ func (p *clusterProxy) CollectWorkloadClusterLogs(ctx context.Context, namespace
260264
}
261265
}
262266

263-
machinePools, err := getMachinePoolsInCluster(ctx, p.GetClient(), namespace, name)
264-
Expect(err).ToNot(HaveOccurred(), "Failed to get machine pools for the %s/%s cluster", namespace, name)
267+
var machinePools *expv1.MachinePoolList
268+
Eventually(func() error {
269+
var err error
270+
machinePools, err = getMachinePoolsInCluster(ctx, p.GetClient(), namespace, name)
271+
return err
272+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to get machine pools for the %s/%s cluster", namespace, name)
265273

266274
for i := range machinePools.Items {
267275
mp := &machinePools.Items[i]

test/framework/clusterresourceset_helpers.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ type GetClusterResourceSetsInput struct {
3939
// GetClusterResourceSets returns all ClusterResourceSet objects in a namespace.
4040
func GetClusterResourceSets(ctx context.Context, input GetClusterResourceSetsInput) []*addonsv1.ClusterResourceSet {
4141
crsList := &addonsv1.ClusterResourceSetList{}
42-
Expect(input.Lister.List(ctx, crsList, client.InNamespace(input.Namespace))).To(Succeed(), "Failed to list ClusterResourceSet objects for namespace %s", input.Namespace)
42+
Eventually(func() error {
43+
return input.Lister.List(ctx, crsList, client.InNamespace(input.Namespace))
44+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list ClusterResourceSet objects for namespace %s", input.Namespace)
4345

4446
clusterResourceSets := make([]*addonsv1.ClusterResourceSet, len(crsList.Items))
4547
for i := range crsList.Items {
@@ -78,12 +80,14 @@ func DiscoverClusterResourceSetAndWaitForSuccess(ctx context.Context, input Disc
7880

7981
mgmtClient := input.ClusterProxy.GetClient()
8082
fmt.Fprintln(GinkgoWriter, "Discovering cluster resource set resources")
81-
clusterResourceSets := GetClusterResourceSets(ctx, GetClusterResourceSetsInput{
82-
Lister: mgmtClient,
83-
Namespace: input.Cluster.Namespace,
84-
})
85-
86-
Expect(clusterResourceSets).NotTo(BeEmpty())
83+
var clusterResourceSets []*addonsv1.ClusterResourceSet
84+
Eventually(func() bool {
85+
clusterResourceSets = GetClusterResourceSets(ctx, GetClusterResourceSetsInput{
86+
Lister: mgmtClient,
87+
Namespace: input.Cluster.Namespace,
88+
})
89+
return len(clusterResourceSets) > 0
90+
}, retryableOperationTimeout, retryableOperationInterval).Should(BeTrue())
8791

8892
for _, crs := range clusterResourceSets {
8993
Expect(crs.Spec.ClusterSelector).NotTo(BeNil())

test/framework/controller_helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ type GetControllerDeploymentsInput struct {
3232
// GetControllerDeployments returns all the deployment for the cluster API controllers existing in a management cluster.
3333
func GetControllerDeployments(ctx context.Context, input GetControllerDeploymentsInput) []*appsv1.Deployment {
3434
deploymentList := &appsv1.DeploymentList{}
35-
Expect(input.Lister.List(ctx, deploymentList, capiProviderOptions()...)).To(Succeed(), "Failed to list deployments for the cluster API controllers")
35+
Eventually(func() error {
36+
return input.Lister.List(ctx, deploymentList, capiProviderOptions()...)
37+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list deployments for the cluster API controllers")
3638

3739
deployments := make([]*appsv1.Deployment, 0, len(deploymentList.Items))
3840
for i := range deploymentList.Items {

test/framework/controlplane_helpers.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ type GetKubeadmControlPlaneByClusterInput struct {
7373
// it is necessary to ensure this is already happened before calling it.
7474
func GetKubeadmControlPlaneByCluster(ctx context.Context, input GetKubeadmControlPlaneByClusterInput) *controlplanev1.KubeadmControlPlane {
7575
controlPlaneList := &controlplanev1.KubeadmControlPlaneList{}
76-
Expect(input.Lister.List(ctx, controlPlaneList, byClusterOptions(input.ClusterName, input.Namespace)...)).To(Succeed(), "Failed to list KubeadmControlPlane object for Cluster %s/%s", input.Namespace, input.ClusterName)
76+
Eventually(func() error {
77+
return input.Lister.List(ctx, controlPlaneList, byClusterOptions(input.ClusterName, input.Namespace)...)
78+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list KubeadmControlPlane object for Cluster %s/%s", input.Namespace, input.ClusterName)
7779
Expect(len(controlPlaneList.Items)).ToNot(BeNumerically(">", 1), "Cluster %s/%s should not have more than 1 KubeadmControlPlane object", input.Namespace, input.ClusterName)
7880
if len(controlPlaneList.Items) == 1 {
7981
return &controlPlaneList.Items[0]
@@ -206,8 +208,9 @@ func AssertControlPlaneFailureDomains(ctx context.Context, input AssertControlPl
206208
}
207209

208210
machineList := &clusterv1.MachineList{}
209-
Expect(input.Lister.List(ctx, machineList, inClustersNamespaceListOption, matchClusterListOption)).
210-
To(Succeed(), "Couldn't list control-plane machines for the cluster %q", input.Cluster.Name)
211+
Eventually(func() error {
212+
return input.Lister.List(ctx, machineList, inClustersNamespaceListOption, matchClusterListOption)
213+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Couldn't list control-plane machines for the cluster %q", input.Cluster.Name)
211214

212215
for _, machine := range machineList.Items {
213216
if machine.Spec.FailureDomain != nil {

test/framework/deployment_helpers.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3838
"k8s.io/apimachinery/pkg/util/intstr"
3939
utilversion "k8s.io/apimachinery/pkg/util/version"
40+
"k8s.io/apimachinery/pkg/version"
4041
"k8s.io/client-go/kubernetes"
4142
"k8s.io/utils/pointer"
4243
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -215,7 +216,9 @@ func WatchPodMetrics(ctx context.Context, input WatchPodMetricsInput) {
215216
Expect(err).NotTo(HaveOccurred(), "Failed to Pods selector for deployment %s/%s", input.Deployment.Namespace, input.Deployment.Name)
216217

217218
pods := &corev1.PodList{}
218-
Expect(input.GetLister.List(ctx, pods, client.InNamespace(input.Deployment.Namespace), client.MatchingLabels(selector))).To(Succeed(), "Failed to list Pods for deployment %s/%s", input.Deployment.Namespace, input.Deployment.Name)
219+
Eventually(func() error {
220+
return input.GetLister.List(ctx, pods, client.InNamespace(input.Deployment.Namespace), client.MatchingLabels(selector))
221+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list Pods for deployment %s/%s", input.Deployment.Namespace, input.Deployment.Name)
219222

220223
go func() {
221224
defer GinkgoRecover()
@@ -363,8 +366,12 @@ func DeployUnevictablePod(ctx context.Context, input DeployUnevictablePodInput)
363366
},
364367
}
365368
if input.ControlPlane != nil {
366-
serverVersion, err := workloadClient.ServerVersion()
367-
Expect(err).ToNot(HaveOccurred())
369+
var serverVersion *version.Info
370+
Eventually(func() error {
371+
var err error
372+
serverVersion, err = workloadClient.ServerVersion()
373+
return err
374+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed())
368375

369376
// Use the control-plane label for Kubernetes version >= v1.20.0.
370377
if utilversion.MustParseGeneric(serverVersion.String()).AtLeast(utilversion.MustParseGeneric("v1.20.0")) {
@@ -447,7 +454,11 @@ type AddPodDisruptionBudgetInput struct {
447454
}
448455

449456
func AddPodDisruptionBudget(ctx context.Context, input AddPodDisruptionBudgetInput) {
450-
budget, err := input.ClientSet.PolicyV1beta1().PodDisruptionBudgets(input.Namespace).Create(ctx, input.Budget, metav1.CreateOptions{})
451-
Expect(budget).NotTo(BeNil())
452-
Expect(err).To(BeNil(), "podDisruptionBudget needs to be successfully deployed")
457+
Eventually(func() error {
458+
budget, err := input.ClientSet.PolicyV1beta1().PodDisruptionBudgets(input.Namespace).Create(ctx, input.Budget, metav1.CreateOptions{})
459+
if budget != nil && err == nil {
460+
return nil
461+
}
462+
return fmt.Errorf("podDisruptionBudget needs to be successfully deployed: %v", err)
463+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "podDisruptionBudget needs to be successfully deployed")
453464
}

test/framework/machine_helpers.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ func GetMachinesByMachineDeployments(ctx context.Context, input GetMachinesByMac
5555
opts = append(opts, machineDeploymentOptions(input.MachineDeployment)...)
5656

5757
machineList := &clusterv1.MachineList{}
58-
Expect(input.Lister.List(ctx, machineList, opts...)).To(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.Namespace, input.ClusterName)
58+
Eventually(func() error {
59+
return input.Lister.List(ctx, machineList, opts...)
60+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.Namespace, input.ClusterName)
5961

6062
return machineList.Items
6163
}
@@ -78,7 +80,9 @@ func GetMachinesByMachineHealthCheck(ctx context.Context, input GetMachinesByMac
7880
opts = append(opts, machineHealthCheckOptions(*input.MachineHealthCheck)...)
7981

8082
machineList := &clusterv1.MachineList{}
81-
Expect(input.Lister.List(ctx, machineList, opts...)).To(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.MachineHealthCheck.Namespace, input.ClusterName)
83+
Eventually(func() error {
84+
return input.Lister.List(ctx, machineList, opts...)
85+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.MachineHealthCheck.Namespace, input.ClusterName)
8286

8387
return machineList.Items
8488
}
@@ -102,7 +106,9 @@ func GetControlPlaneMachinesByCluster(ctx context.Context, input GetControlPlane
102106
options := append(byClusterOptions(input.ClusterName, input.Namespace), controlPlaneMachineOptions()...)
103107

104108
machineList := &clusterv1.MachineList{}
105-
Expect(input.Lister.List(ctx, machineList, options...)).To(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.Namespace, input.ClusterName)
109+
Eventually(func() error {
110+
return input.Lister.List(ctx, machineList, options...)
111+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list MachineList object for Cluster %s/%s", input.Namespace, input.ClusterName)
106112

107113
return machineList.Items
108114
}

test/framework/machinedeployment_helpers.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ type GetMachineDeploymentsByClusterInput struct {
7272
// it is necessary to ensure this is already happened before calling it.
7373
func GetMachineDeploymentsByCluster(ctx context.Context, input GetMachineDeploymentsByClusterInput) []*clusterv1.MachineDeployment {
7474
deploymentList := &clusterv1.MachineDeploymentList{}
75-
Expect(input.Lister.List(ctx, deploymentList, byClusterOptions(input.ClusterName, input.Namespace)...)).To(Succeed(), "Failed to list MachineDeployments object for Cluster %s/%s", input.Namespace, input.ClusterName)
75+
Eventually(func() error {
76+
return input.Lister.List(ctx, deploymentList, byClusterOptions(input.ClusterName, input.Namespace)...)
77+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list MachineDeployments object for Cluster %s/%s", input.Namespace, input.ClusterName)
7678

7779
deployments := make([]*clusterv1.MachineDeployment, len(deploymentList.Items))
7880
for i := range deploymentList.Items {
@@ -148,8 +150,9 @@ func AssertMachineDeploymentFailureDomains(ctx context.Context, input AssertMach
148150
Expect(err).NotTo(HaveOccurred())
149151

150152
ms := &clusterv1.MachineSetList{}
151-
err = input.Lister.List(ctx, ms, client.InNamespace(input.Cluster.Namespace), client.MatchingLabels(selectorMap))
152-
Expect(err).NotTo(HaveOccurred())
153+
Eventually(func() error {
154+
return input.Lister.List(ctx, ms, client.InNamespace(input.Cluster.Namespace), client.MatchingLabels(selectorMap))
155+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed())
153156

154157
for _, machineSet := range ms.Items {
155158
machineSetFD := pointer.StringDeref(machineSet.Spec.Template.Spec.FailureDomain, "<None>")
@@ -159,8 +162,9 @@ func AssertMachineDeploymentFailureDomains(ctx context.Context, input AssertMach
159162
Expect(err).NotTo(HaveOccurred())
160163

161164
machines := &clusterv1.MachineList{}
162-
err = input.Lister.List(ctx, machines, client.InNamespace(machineSet.Namespace), client.MatchingLabels(selectorMap))
163-
Expect(err).NotTo(HaveOccurred())
165+
Eventually(func() error {
166+
return input.Lister.List(ctx, machines, client.InNamespace(machineSet.Namespace), client.MatchingLabels(selectorMap))
167+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed())
164168

165169
for _, machine := range machines.Items {
166170
machineFD := pointer.StringDeref(machine.Spec.FailureDomain, "<None>")
@@ -261,9 +265,9 @@ func WaitForMachineDeploymentRollingUpgradeToStart(ctx context.Context, input Wa
261265
Expect(input.MachineDeployment).ToNot(BeNil(), "Invalid argument. input.MachineDeployment can't be nil when calling WaitForMachineDeploymentRollingUpgradeToStarts")
262266

263267
log.Logf("Waiting for MachineDeployment rolling upgrade to start")
264-
Eventually(func() bool {
268+
Eventually(func(g Gomega) bool {
265269
md := &clusterv1.MachineDeployment{}
266-
Expect(input.Getter.Get(ctx, client.ObjectKey{Namespace: input.MachineDeployment.Namespace, Name: input.MachineDeployment.Name}, md)).To(Succeed())
270+
g.Expect(input.Getter.Get(ctx, client.ObjectKey{Namespace: input.MachineDeployment.Namespace, Name: input.MachineDeployment.Name}, md)).To(Succeed())
267271
return md.Status.Replicas != md.Status.AvailableReplicas
268272
}, intervals...).Should(BeTrue())
269273
}
@@ -281,9 +285,9 @@ func WaitForMachineDeploymentRollingUpgradeToComplete(ctx context.Context, input
281285
Expect(input.MachineDeployment).ToNot(BeNil(), "Invalid argument. input.MachineDeployment can't be nil when calling WaitForMachineDeploymentRollingUpgradeToComplete")
282286

283287
log.Logf("Waiting for MachineDeployment rolling upgrade to complete")
284-
Eventually(func() bool {
288+
Eventually(func(g Gomega) bool {
285289
md := &clusterv1.MachineDeployment{}
286-
Expect(input.Getter.Get(ctx, client.ObjectKey{Namespace: input.MachineDeployment.Namespace, Name: input.MachineDeployment.Name}, md)).To(Succeed())
290+
g.Expect(input.Getter.Get(ctx, client.ObjectKey{Namespace: input.MachineDeployment.Namespace, Name: input.MachineDeployment.Name}, md)).To(Succeed())
287291
return md.Status.Replicas == md.Status.AvailableReplicas
288292
}, intervals...).Should(BeTrue())
289293
}

test/framework/machinehealthcheck_helpers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ type GetMachineHealthChecksForClusterInput struct {
101101
// it is necessary to ensure this is already happened before calling it.
102102
func GetMachineHealthChecksForCluster(ctx context.Context, input GetMachineHealthChecksForClusterInput) []*clusterv1.MachineHealthCheck {
103103
machineHealthCheckList := &clusterv1.MachineHealthCheckList{}
104-
Expect(input.Lister.List(ctx, machineHealthCheckList, byClusterOptions(input.ClusterName, input.Namespace)...)).To(Succeed(), "Failed to list MachineDeployments object for Cluster %s/%s", input.Namespace, input.ClusterName)
104+
Eventually(func() error {
105+
return input.Lister.List(ctx, machineHealthCheckList, byClusterOptions(input.ClusterName, input.Namespace)...)
106+
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to list MachineDeployments object for Cluster %s/%s", input.Namespace, input.ClusterName)
105107

106108
machineHealthChecks := make([]*clusterv1.MachineHealthCheck, len(machineHealthCheckList.Items))
107109
for i := range machineHealthCheckList.Items {

0 commit comments

Comments
 (0)