From fc370930e122b1a5729cc778f9ab2ebe84adf2bb Mon Sep 17 00:00:00 2001 From: Or Sela Date: Wed, 24 Jun 2020 17:33:31 +0300 Subject: [PATCH] reset sync errors on successful sync Signed-off-by: Or Sela --- pkg/cluster/kubernetes/sync.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/kubernetes/sync.go b/pkg/cluster/kubernetes/sync.go index e7203ef9fa..7ffb7e58a4 100644 --- a/pkg/cluster/kubernetes/sync.go +++ b/pkg/cluster/kubernetes/sync.go @@ -115,14 +115,15 @@ func (c *Cluster) Sync(syncSet cluster.SyncSet) error { errs = append(errs, deleteErrs...) } + // It is expected that Cluster.Sync is invoked with *all* resources. + // Otherwise it will override previously recorded sync errors. + c.setSyncErrors(errs) + // If `nil`, errs is a cluster.SyncError(nil) rather than error(nil), so it cannot be returned directly. if errs == nil { return nil } - // It is expected that Cluster.Sync is invoked with *all* resources. - // Otherwise it will override previously recorded sync errors. - c.setSyncErrors(errs) return errs }