Skip to content

Commit

Permalink
fix: k8s resource check
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Dec 23, 2024
1 parent bbda04c commit 75219b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions checks/kubernetes_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (c *KubernetesResourceChecker) Check(ctx context.Context, check v1.Kubernet
return nil
})
if retryErr != nil {
return results.Failf(retryErr.Error())
return results.ErrorMessage(retryErr)
}
}

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

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

resourceObjs, err := ctx.KubernetesClient().FetchResources(ctx, append(check.StaticResources, check.Resources...)...)
resourceObjs, err = ctx.KubernetesClient().FetchResources(ctx, append(check.StaticResources, check.Resources...)...)
if err != nil {
if apiErrors.IsNotFound(err) {
return retry.RetryableError(err)
Expand Down

0 comments on commit 75219b6

Please sign in to comment.