diff --git a/internal/pkg/container/container.go b/internal/pkg/container/container.go index 274e1ae..4aefb68 100644 --- a/internal/pkg/container/container.go +++ b/internal/pkg/container/container.go @@ -287,7 +287,7 @@ func (c *Container) IsCreated() bool { func (c *Container) UpdateCommands() command.Commands { wasRunning := false return command.Commands{ - command.NewFunc("do_update_and_stop", func() error { + command.NewFunc("pull_and_stop", func() error { err := c.pull() if err != nil { return err @@ -295,18 +295,11 @@ func (c *Container) UpdateCommands() command.Commands { wasRunning = c.cdata != nil && c.cdata.State != nil && c.cdata.State.Running if wasRunning { var timeout uint = 10 - err := containers.Stop(c.conn, c.cdata.ID, &containers.StopOptions{Timeout: &timeout}) - if err != nil { - return err - } - _, err = containers.Remove(c.conn, c.cdata.ID, nil) - if err != nil { - return err - } - c.cdata = nil + _ = containers.Stop(c.conn, c.cdata.ID, &containers.StopOptions{Timeout: &timeout}) } return nil }), + command.NewSet(c.DestroyCommands()), command.NewSet(c.CreateCommands()), command.NewConditional("restart_if_was_running", func() bool { return wasRunning },