Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnamehrotra committed Aug 21, 2023
1 parent b4c044b commit 9c8d764
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/imagejob/imagejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,24 +456,24 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
func podsComplete(podList []corev1.Pod) bool {
for i := range podList {
if podList[i].Status.Phase == corev1.PodRunning || podList[i].Status.Phase == corev1.PodPending {
if containersNotFailed(podList[i]) {
return false
} else {
if containersFailed(&podList[i]) {

Check failure on line 459 in controllers/imagejob/imagejob_controller.go

View workflow job for this annotation

GitHub Actions / Lint

S1008: should use 'return containersFailed(&podList[i])' instead of 'if containersFailed(&podList[i]) { return true }; return false' (gosimple)
return true
}
return false
}
}
return true
}

func containersNotFailed(pod corev1.Pod) bool {
func containersFailed(pod *corev1.Pod) bool {
statuses := pod.Status.ContainerStatuses
log.Info("Statuses", "container statuses", statuses)
for i := range statuses {
if statuses[i].State.Terminated != nil {
return false
return true
}
}
return true
return false
}

func (r *Reconciler) updateJobStatus(ctx context.Context, imageJob *eraserv1.ImageJob) error {
Expand Down

0 comments on commit 9c8d764

Please sign in to comment.