diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index 105ea13c56..3c3a580497 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -33,7 +33,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, if mode == entities.CreateMode { // regular create flags annotationFlagName := "annotation" - createFlags.StringSliceVar( + createFlags.StringArrayVar( &cf.Annotation, annotationFlagName, []string{}, "Add annotations to container (key=value)", diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index f9aa0f8bbd..8d777647e6 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -101,7 +101,7 @@ var _ = Describe("Podman create", func() { }) It("podman create adds annotation", func() { - session := podmanTest.Podman([]string{"create", "--annotation", "HELLO=WORLD", "--name", "annotate_test", ALPINE, "ls"}) + session := podmanTest.Podman([]string{"create", "--annotation", "HELLO=WORLD,WithComma", "--name", "annotate_test", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) Expect(podmanTest.NumberOfContainers()).To(Equal(1)) @@ -109,7 +109,7 @@ var _ = Describe("Podman create", func() { check := podmanTest.Podman([]string{"inspect", "annotate_test"}) check.WaitWithDefaultTimeout() data := check.InspectContainerToJSON() - Expect(data[0].Config.Annotations).To(HaveKeyWithValue("HELLO", "WORLD")) + Expect(data[0].Config.Annotations).To(HaveKeyWithValue("HELLO", "WORLD,WithComma")) }) It("podman create --entrypoint command", func() {