summaryrefslogtreecommitdiff
path: root/test/e2e/container_inspect_test.go
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@suse.com>2019-09-03 11:10:01 +0200
committerSascha Grunert <sgrunert@suse.com>2019-09-10 09:37:14 +0200
commitdf036f9f8eafe3d1355cfe9e52c69a07e8f79b63 (patch)
tree4e02a3781d5b29d404aedd740dc1111508bca0c2 /test/e2e/container_inspect_test.go
parent9a55bce9e4d7e1bb3d57dc8879e1a23f559e18ba (diff)
downloadpodman-df036f9f8eafe3d1355cfe9e52c69a07e8f79b63.tar.gz
podman-df036f9f8eafe3d1355cfe9e52c69a07e8f79b63.tar.bz2
podman-df036f9f8eafe3d1355cfe9e52c69a07e8f79b63.zip
Add `ContainerManager` annotation to created containers
This change adds the following annotation to every container created by podman: ```json "Annotations": { "io.containers.manager": "libpod" } ``` Target of this annotaions is to indicate which project in the containers ecosystem is the major manager of a container when applications share the same storage paths. This way projects can decide if they want to manipulate the container or not. For example, since CRI-O and podman are not using the same container library (libpod), CRI-O can skip podman containers and provide the end user more useful information. A corresponding end-to-end test has been adapted as well. Relates to: https://github.com/cri-o/cri-o/pull/2761 Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'test/e2e/container_inspect_test.go')
-rw-r--r--test/e2e/container_inspect_test.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/e2e/container_inspect_test.go b/test/e2e/container_inspect_test.go
new file mode 100644
index 000000000..91c025197
--- /dev/null
+++ b/test/e2e/container_inspect_test.go
@@ -0,0 +1,45 @@
+package integration
+
+import (
+ "os"
+
+ "github.com/containers/libpod/pkg/annotations"
+ . "github.com/containers/libpod/test/utils"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("Podman container inspect", func() {
+ var (
+ tempdir string
+ err error
+ podmanTest *PodmanTestIntegration
+ )
+
+ BeforeEach(func() {
+ tempdir, err = CreateTempDirInTempDir()
+ if err != nil {
+ os.Exit(1)
+ }
+ podmanTest = PodmanTestCreate(tempdir)
+ podmanTest.Setup()
+ podmanTest.SeedImages()
+ })
+
+ AfterEach(func() {
+ podmanTest.CleanupPod()
+ f := CurrentGinkgoTestDescription()
+ processTestResult(f)
+ })
+
+ It("podman inspect a container for the container manager annotation", func() {
+ const testContainer = "container-inspect-test-1"
+ setup := podmanTest.RunTopContainer(testContainer)
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ data := podmanTest.InspectContainer(testContainer)
+ Expect(data[0].Config.Annotations[annotations.ContainerManager]).
+ To(Equal(annotations.ContainerManagerLibpod))
+ })
+})