Add defer and close status-check log file correctly
In, had left code review comments to
1) move `postStatusCheckFn()` as soon as it got defined and
2) add a defer.
I only addressed part 1 creating a bug.
Now addressing part 2.
Thanks for bringing this to my attention.
@@ -92,7 +92,7 @@ See https://skaffold.dev/docs/pipeline-stages/taggers/#how-tagging-works`)
r.hasDeployed = true
statusCheckOut, postStatusCheckFn, err := deployutil.WithStatusCheckLogFile(time.Now().Format(deployutil.TimeFormat)+".log", out, r.runCtx.Muted())
- postStatusCheckFn()
+ defer postStatusCheckFn()
if err != nil {
return err
}
