Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if new container image is available before removing old container #217

Open
invidian opened this issue Jan 4, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@invidian
Copy link
Member

invidian commented Jan 4, 2021

No description provided.

@invidian invidian added the enhancement New feature or request label Jan 4, 2021
@invidian
Copy link
Member Author

invidian commented Mar 1, 2021

That can be done in

// recreate is a helper, which removes container from current state and creates new one from
// desired state.
func (c *containers) recreate(n string) error {
if err := c.currentState.RemoveContainer(n); err != nil {
return fmt.Errorf("failed removing old container to recreate it: %w", err)
}
c.currentState[n] = nil
err := c.desiredState.CreateAndStart(n)
c.currentState[n] = c.desiredState[n]
if err != nil {
return fmt.Errorf("creating and starting new container %q: %w", n, err)
}
return nil
}
, maybe we could create a config container or something using new image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant