fix(edge-stacks): take not-found stack as removed EE-6758 (#11248)

pull/11289/head
cmeng 2024-03-01 11:50:20 +13:00 committed by GitHub
parent 88185d7f6d
commit 385fd95779
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View File

@ -135,6 +135,11 @@ func (handler *Handler) updateEdgeStackStatus(tx dataservices.DataStoreTx, r *ht
}
func updateEnvStatus(environmentId portainer.EndpointID, stack *portainer.EdgeStack, deploymentStatus portainer.EdgeStackDeploymentStatus) {
if deploymentStatus.Type == portainer.EdgeStackStatusRemoved {
delete(stack.Status, environmentId)
return
}
environmentStatus, ok := stack.Status[environmentId]
if !ok {
environmentStatus = portainer.EdgeStackStatus{

View File

@ -39,11 +39,13 @@ export function DeploymentCounter({
total: number;
type?: StatusType;
}) {
const width = total ? (count / total) * 100 : 0;
return (
<TooltipWithChildren message={getTooltip(count, total, type)}>
<div className="h-2 w-full overflow-hidden rounded-lg bg-gray-4">
<div
style={{ width: `${(count / total) * 100}%` }}
style={{ width: `${width}%` }}
className={clsx('h-full rounded-lg', {
'bg-success-7': type === StatusType.Running,
'bg-error-7': type === StatusType.Error,

View File

@ -127,6 +127,12 @@ func (wrapper *PluginWrapper) WaitForStatus(ctx context.Context, name string, st
log.Debug().
Str("project_name", name).
Msg("no output from docker compose ps")
if status == libstack.StatusRemoved {
errorMessageCh <- ""
return
}
continue
}