Skip to content

Commit

Permalink
implement cache wipe in control loop
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Sep 29, 2023
1 parent feba2e9 commit a8d1286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions pkg/sync/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a8d1286

Please sign in to comment.