mirror of
https://github.com/containers/podman.git
synced 2025-06-19 08:09:12 +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()
|
||||
|
||||
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)
|
||||
|
||||
archFlagName := "arch"
|
||||
|
@ -347,7 +347,7 @@ add_compression = ["zstd"]`), 0o644)
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageListInstance})
|
||||
session.WaitWithDefaultTimeout()
|
||||
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()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
@ -355,7 +355,7 @@ add_compression = ["zstd"]`), 0o644)
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"architecture": "bar"`))
|
||||
// Check added annotation
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"hello": "world"`))
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"hello": "world,withcomma"`))
|
||||
})
|
||||
|
||||
It("remove digest", func() {
|
||||
|
Reference in New Issue
Block a user