Don't include ctr.log if not using file logging

Checkpoint is blowing up when you use --log-driver=none

[NO NEW TESTS NEEDED] No way currently to test checkpoint restore.

Fixes: https://github.com/containers/podman/issues/11974

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2021-10-14 14:08:51 -04:00
parent 8d44c548c0
commit f9ff0525c5
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028
1 changed files with 4 additions and 1 deletions

View File

@ -1008,12 +1008,15 @@ func (c *Container) exportCheckpoint(options ContainerCheckpointOptions) error {
includeFiles := []string{
"artifacts",
"ctr.log",
metadata.ConfigDumpFile,
metadata.SpecDumpFile,
metadata.NetworkStatusFile,
}
if c.LogDriver() == define.KubernetesLogging ||
c.LogDriver() == define.JSONLogging {
includeFiles = append(includeFiles, "ctr.log")
}
if options.PreCheckPoint {
includeFiles = append(includeFiles, preCheckpointDir)
} else {