Skip to content

Commit 90dcdfd

Browse files
authored
Merge pull request #287 from fluxcd/log-when-rmall
Log the error when removing the working dir fails
2 parents f82654d + 8e1f31f commit 90dcdfd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

controllers/imageupdateautomation_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
215215
if err != nil {
216216
return failWithError(err)
217217
}
218-
defer os.RemoveAll(tmp)
218+
defer func() {
219+
if err := os.RemoveAll(tmp); err != nil {
220+
log.Error(err, "failed to remove working directory", "path", tmp)
221+
}
222+
}()
219223

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

0 commit comments

Comments
 (0)