diff --git a/cmd/podman/manifest/add.go b/cmd/podman/manifest/add.go index 490be688b9..f957ee4632 100644 --- a/cmd/podman/manifest/add.go +++ b/cmd/podman/manifest/add.go @@ -48,7 +48,7 @@ func init() { flags.BoolVar(&manifestAddOpts.All, "all", false, "add all of the list's images if the image is a list") annotationFlagName := "annotation" - flags.StringSliceVar(&manifestAddOpts.Annotation, annotationFlagName, nil, "set an `annotation` for the specified image") + flags.StringArrayVar(&manifestAddOpts.Annotation, annotationFlagName, nil, "set an `annotation` for the specified image") _ = addCmd.RegisterFlagCompletionFunc(annotationFlagName, completion.AutocompleteNone) archFlagName := "arch" diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index 744108dcff..7c60e67978 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -314,7 +314,7 @@ add_compression = ["zstd"]`), 0o644) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(125)) Expect(session.ErrorToString()).To(ContainSubstring("no value given for annotation")) - session = podmanTest.Podman([]string{"manifest", "add", "--annotation", "hoge=fuga", "foo", imageList}) + session = podmanTest.Podman([]string{"manifest", "add", "--annotation", "hoge=fuga", "--annotation", "key=val,withcomma", "foo", imageList}) session.WaitWithDefaultTimeout() Expect(session).Should(ExitCleanly()) session = podmanTest.Podman([]string{"manifest", "inspect", "foo"}) @@ -324,7 +324,7 @@ add_compression = ["zstd"]`), 0o644) var inspect define.ManifestListData err := json.Unmarshal(session.Out.Contents(), &inspect) Expect(err).ToNot(HaveOccurred()) - Expect(inspect.Manifests[0].Annotations).To(Equal(map[string]string{"hoge": "fuga"})) + Expect(inspect.Manifests[0].Annotations).To(Equal(map[string]string{"hoge": "fuga", "key": "val,withcomma"})) }) It("add --os", func() {