From f30fbd78232e274887da689ca46e2f61918cb8ab 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 Signed-off-by: Kingdon Barrett --- 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 155e9ec55..71d42c0cb 100644 --- a/pkg/cluster/kubernetes/sync.go +++ b/pkg/cluster/kubernetes/sync.go @@ -116,14 +116,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 }