summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-09-07 14:16:01 -0400
committerMatthew Heon <mheon@redhat.com>2021-09-07 14:16:01 -0400
commitbfcd83ecd680fccd2efeadf695a9cd2c603a997f (patch)
treeb0fe8aa8c509228c00d818cff4c13b20f2b83223 /libpod/container_internal.go
parent536f23c0b78dd8feafee4e40b743988dbb03bfa2 (diff)
downloadpodman-bfcd83ecd680fccd2efeadf695a9cd2c603a997f.tar.gz
podman-bfcd83ecd680fccd2efeadf695a9cd2c603a997f.tar.bz2
podman-bfcd83ecd680fccd2efeadf695a9cd2c603a997f.zip
Add Checkpointed bool to Inspect
When inspecting a container, we now report whether the container was stopped by a `podman checkpoint` operation via a new bool in the State portion of inspected, `Checkpointed`. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 9082b136a..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.
@@ -1110,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