mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
fix(edge): redeploy edge stack doesn't apply to std agents [BE-11766] (#633)
This commit is contained in:
parent
f82921d2a1
commit
ebc25e45d3
1 changed files with 8 additions and 0 deletions
|
@ -93,6 +93,10 @@ func (service ServiceTx) AddEndpointRelationsForEdgeStack(endpointIDs []portaine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service.service.mu.Lock()
|
||||||
|
service.service.endpointRelationsCache = nil
|
||||||
|
service.service.mu.Unlock()
|
||||||
|
|
||||||
if err := service.service.updateStackFnTx(service.tx, edgeStackID, func(edgeStack *portainer.EdgeStack) {
|
if err := service.service.updateStackFnTx(service.tx, edgeStackID, func(edgeStack *portainer.EdgeStack) {
|
||||||
edgeStack.NumDeployments += len(endpointIDs)
|
edgeStack.NumDeployments += len(endpointIDs)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
@ -119,6 +123,10 @@ func (service ServiceTx) RemoveEndpointRelationsForEdgeStack(endpointIDs []porta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service.service.mu.Lock()
|
||||||
|
service.service.endpointRelationsCache = nil
|
||||||
|
service.service.mu.Unlock()
|
||||||
|
|
||||||
if err := service.service.updateStackFnTx(service.tx, edgeStackID, func(edgeStack *portainer.EdgeStack) {
|
if err := service.service.updateStackFnTx(service.tx, edgeStackID, func(edgeStack *portainer.EdgeStack) {
|
||||||
edgeStack.NumDeployments -= len(endpointIDs)
|
edgeStack.NumDeployments -= len(endpointIDs)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue