aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 3f7a4807d..4d1a25541 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -584,6 +584,7 @@ func resetState(state *ContainerState) {
state.StoppedByUser = false
state.RestartPolicyMatch = false
state.RestartCount = 0
+ state.Checkpointed = false
}
// Refresh refreshes the container's state after a restart.
@@ -972,11 +973,12 @@ func (c *Container) checkDependenciesRunning() ([]string, error) {
}
// Check the status
+ conf := depCtr.Config()
state, err := depCtr.State()
if err != nil {
return nil, errors.Wrapf(err, "error retrieving state of dependency %s of container %s", dep, c.ID())
}
- if state != define.ContainerStateRunning {
+ if state != define.ContainerStateRunning && !conf.IsInfra {
notRunning = append(notRunning, dep)
}
depCtrs[dep] = depCtr
@@ -1071,6 +1073,11 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
return err
}
+ // Make sure the workdir exists while initializing container
+ if err := c.resolveWorkDir(); err != nil {
+ return err
+ }
+
// Save the OCI newSpec to disk
if err := c.saveSpec(newSpec); err != nil {
return err
@@ -1104,6 +1111,7 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
c.state.ExecSessions = make(map[string]*ExecSession)
}
+ c.state.Checkpointed = false
c.state.ExitCode = 0
c.state.Exited = false
c.state.State = define.ContainerStateCreated