Skip to content

Commit

Permalink
Merge pull request #287 from fluxcd/log-when-rmall
Browse files Browse the repository at this point in the history
Log the error when removing the working dir fails
  • Loading branch information
squaremo authored Jan 6, 2022
2 parents f82654d + 8e1f31f commit 90dcdfd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/imageupdateautomation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
if err != nil {
return failWithError(err)
}
defer os.RemoveAll(tmp)
defer func() {
if err := os.RemoveAll(tmp); err != nil {
log.Error(err, "failed to remove working directory", "path", tmp)
}
}()

// FIXME use context with deadline for at least the following ops

Expand Down

0 comments on commit 90dcdfd

Please sign in to comment.