Skip to content

Commit

Permalink
testing possible fix 2
Browse files Browse the repository at this point in the history
Signed-off-by: ashnamehrotra <[email protected]>
  • Loading branch information
ashnamehrotra committed Sep 26, 2023
1 parent 1edca36 commit 2d105d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/imagejob/imagejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,17 @@ func (r *Reconciler) handleRunningJob(ctx context.Context, imageJob *eraserv1.Im
template := corev1.PodTemplate{}
namespace := eraserUtils.GetNamespace()

// its failing here - pod template not found
err := r.Get(ctx, types.NamespacedName{
Name: imageJob.GetName(),
Namespace: namespace,
}, &template)
if err != nil {
return err
imageJob.Status = eraserv1.ImageJobStatus{
Phase: eraserv1.PhaseFailed,
DeleteAfter: controllerUtils.After(time.Now(), 1),
}
return r.updateJobStatus(ctx, imageJob)
}

listOpts := podListOptions(&template)
Expand Down

0 comments on commit 2d105d0

Please sign in to comment.