mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
cli: podman manifest annotate --annotation use StringArray()
This option accepts arbitrary input so we should allow commas in it. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -31,7 +31,7 @@ func init() {
|
|||||||
flags := annotateCmd.Flags()
|
flags := annotateCmd.Flags()
|
||||||
|
|
||||||
annotationFlagName := "annotation"
|
annotationFlagName := "annotation"
|
||||||
flags.StringSliceVar(&manifestAnnotateOpts.Annotation, annotationFlagName, nil, "set an `annotation` for the specified image")
|
flags.StringArrayVar(&manifestAnnotateOpts.Annotation, annotationFlagName, nil, "set an `annotation` for the specified image")
|
||||||
_ = annotateCmd.RegisterFlagCompletionFunc(annotationFlagName, completion.AutocompleteNone)
|
_ = annotateCmd.RegisterFlagCompletionFunc(annotationFlagName, completion.AutocompleteNone)
|
||||||
|
|
||||||
archFlagName := "arch"
|
archFlagName := "arch"
|
||||||
|
@ -347,7 +347,7 @@ add_compression = ["zstd"]`), 0o644)
|
|||||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageListInstance})
|
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageListInstance})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
session = podmanTest.Podman([]string{"manifest", "annotate", "--annotation", "hello=world", "--arch", "bar", "foo", imageListARM64InstanceDigest})
|
session = podmanTest.Podman([]string{"manifest", "annotate", "--annotation", "hello=world,withcomma", "--arch", "bar", "foo", imageListARM64InstanceDigest})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||||
@ -355,7 +355,7 @@ add_compression = ["zstd"]`), 0o644)
|
|||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(`"architecture": "bar"`))
|
Expect(session.OutputToString()).To(ContainSubstring(`"architecture": "bar"`))
|
||||||
// Check added annotation
|
// Check added annotation
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(`"hello": "world"`))
|
Expect(session.OutputToString()).To(ContainSubstring(`"hello": "world,withcomma"`))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("remove digest", func() {
|
It("remove digest", func() {
|
||||||
|
Reference in New Issue
Block a user