mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 23:39:41 +02:00
fix(stack/compose): remove the orphan containers if stack deployment is failed (#7599)
This commit is contained in:
parent
88757d2617
commit
ccaf2bedb7
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue