Merge pull request #287 from fluxcd/log-when-rmall

Log the error when removing the working dir fails
This commit is contained in:
Michael Bridgen 2022-01-06 10:06:41 +00:00 committed by GitHub
commit 90dcdfd7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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