mirror of https://github.com/portainer/portainer
fix(stack/compose): remove the orphan containers if stack deployment is failed (#7599)
parent
88757d2617
commit
ccaf2bedb7
|
@ -52,7 +52,11 @@ func (d *stackDeployer) DeployComposeStack(stack *portainer.Stack, endpoint *por
|
||||||
d.swarmStackManager.Login(registries, endpoint)
|
d.swarmStackManager.Login(registries, endpoint)
|
||||||
defer d.swarmStackManager.Logout(endpoint)
|
defer d.swarmStackManager.Logout(endpoint)
|
||||||
|
|
||||||
return d.composeStackManager.Up(context.TODO(), stack, endpoint, forceRereate)
|
err := d.composeStackManager.Up(context.TODO(), stack, endpoint, forceRereate)
|
||||||
|
if err != nil {
|
||||||
|
d.composeStackManager.Down(context.TODO(), stack, endpoint)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *stackDeployer) DeployKubernetesStack(stack *portainer.Stack, endpoint *portainer.Endpoint, user *portainer.User) error {
|
func (d *stackDeployer) DeployKubernetesStack(stack *portainer.Stack, endpoint *portainer.Endpoint, user *portainer.User) error {
|
||||||
|
|
Loading…
Reference in New Issue