diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 7a602a34..0d656d6b 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -87,6 +87,7 @@ func (agent *Agent) Run() { for { log.Info("fetching services for cluster") + agent.engine.WipeCache() svcs, err := agent.consoleClient.GetServices() if err != nil { log.Error(err, "failed to fetch service list from deployments service") diff --git a/pkg/sync/engine.go b/pkg/sync/engine.go index 7b70fb21..3f126179 100644 --- a/pkg/sync/engine.go +++ b/pkg/sync/engine.go @@ -46,6 +46,11 @@ func (engine *Engine) RegisterHandlers() { }) } +func (engine *Engine) WipeCache() { + engine.svcCache.Wipe() + engine.manifestCache.Wipe() +} + func isRoot(r *cache.Resource) bool { return svcId(r) != nil && len(r.OwnerRefs) == 0 }