Skip to content

Commit 75219b6

Browse files
committed
fix: k8s resource check
1 parent bbda04c commit 75219b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

checks/kubernetes_resource.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (c *KubernetesResourceChecker) Check(ctx context.Context, check v1.Kubernet
215215
return nil
216216
})
217217
if retryErr != nil {
218-
return results.Failf(retryErr.Error())
218+
return results.ErrorMessage(retryErr)
219219
}
220220
}
221221

@@ -239,6 +239,7 @@ func (c *KubernetesResourceChecker) evalWaitFor(ctx context.Context, check v1.Ku
239239
waitInterval = wt
240240
}
241241
var resourceObjs []unstructured.Unstructured
242+
var err error
242243
var attempts int
243244
backoff := retry.WithMaxDuration(waitTimeout, retry.NewConstant(waitInterval))
244245
retryErr := retry.Do(ctx, backoff, func(_ctx gocontext.Context) error {
@@ -247,7 +248,7 @@ func (c *KubernetesResourceChecker) evalWaitFor(ctx context.Context, check v1.Ku
247248

248249
ctx.Tracef("waiting for %d resources, attempt=%d, timeout=%s", check.TotalResources(), attempts, waitTimeout)
249250

250-
resourceObjs, err := ctx.KubernetesClient().FetchResources(ctx, append(check.StaticResources, check.Resources...)...)
251+
resourceObjs, err = ctx.KubernetesClient().FetchResources(ctx, append(check.StaticResources, check.Resources...)...)
251252
if err != nil {
252253
if apiErrors.IsNotFound(err) {
253254
return retry.RetryableError(err)

0 commit comments

Comments
 (0)