Skip to content

Commit 950886b

Browse files
committed
fix(rhai): fix linter errors - errcheck and staticcheck
Made-with: Cursor
1 parent 760b0d1 commit 950886b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/rhai/progression/progression.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func PollTrainingProgress(ctx context.Context, pod *corev1.Pod, metricsPort stri
274274
if err != nil {
275275
return nil, fmt.Errorf("failed to fetch metrics from %s: %w", metricsURL, err)
276276
}
277-
defer resp.Body.Close()
277+
defer func() { _ = resp.Body.Close() }()
278278

279279
if resp.StatusCode != http.StatusOK {
280280
return nil, fmt.Errorf("unexpected status code %d from metrics endpoint", resp.StatusCode)
@@ -666,8 +666,8 @@ func PollAndUpdateFinalProgress(ctx context.Context, c client.Client, reader cli
666666
}
667667
// updateFinalStatus is a no-op when no prior annotation exists (metrics were never polled).
668668
// Skip the patch and signal "captured" to prevent an infinite requeue loop.
669-
oldAnnotation, _ := oldTrainJob.Annotations[constants.AnnotationTrainerStatus]
670-
newAnnotation, _ := trainJob.Annotations[constants.AnnotationTrainerStatus]
669+
oldAnnotation := oldTrainJob.Annotations[constants.AnnotationTrainerStatus]
670+
newAnnotation := trainJob.Annotations[constants.AnnotationTrainerStatus]
671671
if oldAnnotation == newAnnotation {
672672
return true, nil
673673
}

0 commit comments

Comments
 (0)