Merge pull request #3742 from adrianreber/ConmonPidFile

Conmon pid file
This commit is contained in:
OpenShift Merge Robot 2019-08-10 12:01:45 +02:00 committed by GitHub
commit 8c77dd77af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View File

@ -54,6 +54,14 @@ func (r *Runtime) RestoreContainer(ctx context.Context, rSpec *spec.Spec, config
}
// For an imported checkpoint no one has ever set the StartedTime. Set it now.
ctr.state.StartedTime = time.Now()
// If the path to ConmonPidFile starts with the default value (RunRoot), then
// the user has not specified '--conmon-pidfile' during run or create (probably).
// In that case reset ConmonPidFile to be set to the default value later.
if strings.HasPrefix(ctr.config.ConmonPidFile, r.config.StorageConfig.RunRoot) {
ctr.config.ConmonPidFile = ""
}
return r.setupContainer(ctx, ctr)
}

View File

@ -375,23 +375,28 @@ var _ = Describe("Podman checkpoint", func() {
result := podmanTest.Podman([]string{"container", "checkpoint", "-l", "-e", fileName})
result.WaitWithDefaultTimeout()
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
result = podmanTest.Podman([]string{"container", "restore", "-i", fileName})
// Restore container the first time with different name.
// Using '--ignore-static-ip' as for parallel test runs
// each containers gets a random IP address via '--ip'.
// '--ignore-static-ip' tells the restore to use the next
// available IP address.
// First restore the container with a new name/ID to make
// sure nothing in the restored container depends on the
// original container.
result = podmanTest.Podman([]string{"container", "restore", "-i", fileName, "-n", "restore_again", "--ignore-static-ip"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
// Restore container a second time with different name.
// Using '--ignore-static-ip' as for parallel test runs
// each containers gets a random IP address via '--ip'.
// '--ignore-static-ip' tells the restore to use the next
// available IP address.
result = podmanTest.Podman([]string{"container", "restore", "-i", fileName, "-n", "restore_again", "--ignore-static-ip"})
result = podmanTest.Podman([]string{"container", "restore", "-i", fileName})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))