mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
fix(edgestacks): fix edge stacks cache invalidation EE-4909 (#8399)
This commit is contained in:
parent
42ca1287df
commit
5f3dd0a64f
3 changed files with 41 additions and 77 deletions
|
@ -95,3 +95,19 @@ func (service *Service) DeleteEndpointRelation(endpointID portainer.EndpointID)
|
|||
|
||||
return err
|
||||
}
|
||||
|
||||
func (service *Service) InvalidateEdgeCacheForEdgeStack(edgeStackID portainer.EdgeStackID) {
|
||||
rels, err := service.EndpointRelations()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("cannot retrieve endpoint relations")
|
||||
return
|
||||
}
|
||||
|
||||
for _, rel := range rels {
|
||||
for id := range rel.EdgeStacks {
|
||||
if edgeStackID == id {
|
||||
cache.Del(rel.EndpointID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue