From 37031465c050c9d3b0f2c99c0d5db7f7997ef7a1 Mon Sep 17 00:00:00 2001 From: Chris Kim <30601846+Oats87@users.noreply.github.com> Date: Tue, 24 Aug 2021 12:17:22 -1000 Subject: [PATCH] Fix unnecessary writing of successful output to failure in the event that the prior plan had failed but the current one is successful (#52) Signed-off-by: Chris Kim --- pkg/k8splan/watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/k8splan/watcher.go b/pkg/k8splan/watcher.go index 36e2a491..cca7a26d 100644 --- a/pkg/k8splan/watcher.go +++ b/pkg/k8splan/watcher.go @@ -264,7 +264,7 @@ func (w *watcher) start(ctx context.Context) { } } - if errorFromApply != nil || wasFailedPlan { + if errorFromApply != nil || (wasFailedPlan && !needsApplied) { logrus.Debugf("[K8s] Plan with checksum (%s) failed during application", cp.Checksum) // Update the corresponding counts/outputs secret.Data[failedChecksumKey] = []byte(cp.Checksum)