mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Merge pull request #3039 from mheon/podman_init
Add podman init command
This commit is contained in:
@ -811,8 +811,9 @@ func (c *Container) cleanupRuntime(ctx context.Context) error {
|
||||
span.SetTag("struct", "container")
|
||||
defer span.Finish()
|
||||
|
||||
// If the container is not ContainerStateStopped, do nothing
|
||||
if c.state.State != ContainerStateStopped {
|
||||
// If the container is not ContainerStateStopped or
|
||||
// ContainerStateCreated, do nothing.
|
||||
if c.state.State != ContainerStateStopped && c.state.State != ContainerStateCreated {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -825,9 +826,14 @@ func (c *Container) cleanupRuntime(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Our state is now Exited, as we've removed ourself from
|
||||
// the runtime.
|
||||
c.state.State = ContainerStateExited
|
||||
// If we were Stopped, we are now Exited, as we've removed ourself
|
||||
// from the runtime.
|
||||
// If we were Created, we are now Configured.
|
||||
if c.state.State == ContainerStateStopped {
|
||||
c.state.State = ContainerStateExited
|
||||
} else if c.state.State == ContainerStateCreated {
|
||||
c.state.State = ContainerStateConfigured
|
||||
}
|
||||
|
||||
if c.valid {
|
||||
if err := c.save(); err != nil {
|
||||
|
Reference in New Issue
Block a user