mirror of https://github.com/portainer/portainer
fix(edgestacks): avoid repeated statuses BE-11561 (#351)
parent
b753371700
commit
b30a1b5250
|
@ -4,6 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -136,7 +137,11 @@ func updateEnvStatus(environmentId portainer.EndpointID, stack *portainer.EdgeSt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if containsStatus := slices.ContainsFunc(environmentStatus.Status, func(e portainer.EdgeStackDeploymentStatus) bool {
|
||||||
|
return e.Type == deploymentStatus.Type
|
||||||
|
}); !containsStatus {
|
||||||
environmentStatus.Status = append(environmentStatus.Status, deploymentStatus)
|
environmentStatus.Status = append(environmentStatus.Status, deploymentStatus)
|
||||||
|
}
|
||||||
|
|
||||||
stack.Status[environmentId] = environmentStatus
|
stack.Status[environmentId] = environmentStatus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue