diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-15 15:53:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 15:53:16 +0100 |
commit | a50d0837b633bf780b32a20b8d4f23ccd9521c8d (patch) | |
tree | 6b24e2243b6a8178ba9581de545d21df82bdb4d5 /cmd/podman/manifest/annotate.go | |
parent | b84131eef879049a43f7cd00831575fa118cdefb (diff) | |
parent | 8a7e70919f4bab0757523ae97c170396cb13c83d (diff) | |
download | podman-a50d0837b633bf780b32a20b8d4f23ccd9521c8d.tar.gz podman-a50d0837b633bf780b32a20b8d4f23ccd9521c8d.tar.bz2 podman-a50d0837b633bf780b32a20b8d4f23ccd9521c8d.zip |
Merge pull request #12527 from jwhonce/wip/manifest4
Refactor manifest list operations
Diffstat (limited to 'cmd/podman/manifest/annotate.go')
-rw-r--r-- | cmd/podman/manifest/annotate.go | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/cmd/podman/manifest/annotate.go b/cmd/podman/manifest/annotate.go index d806ce9e6..a032a1fe5 100644 --- a/cmd/podman/manifest/annotate.go +++ b/cmd/podman/manifest/annotate.go @@ -1,14 +1,12 @@ package manifest import ( - "context" "fmt" "github.com/containers/common/pkg/completion" "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -20,8 +18,8 @@ var ( Short: "Add or update information about an entry in a manifest list or image index", Long: "Adds or updates information about an entry in a manifest list or image index.", RunE: annotate, - Example: `podman manifest annotate --annotation left=right mylist:v1.11 image:v1.11-amd64`, Args: cobra.ExactArgs(2), + Example: `podman manifest annotate --annotation left=right mylist:v1.11 image:v1.11-amd64`, ValidArgsFunction: common.AutocompleteImages, } ) @@ -63,18 +61,10 @@ func init() { } func annotate(cmd *cobra.Command, args []string) error { - listImageSpec := args[0] - instanceSpec := args[1] - if listImageSpec == "" { - return errors.Errorf(`invalid image name "%s"`, listImageSpec) - } - if instanceSpec == "" { - return errors.Errorf(`invalid image digest "%s"`, instanceSpec) - } - updatedListID, err := registry.ImageEngine().ManifestAnnotate(context.Background(), args, manifestAnnotateOpts) + id, err := registry.ImageEngine().ManifestAnnotate(registry.Context(), args[0], args[1], manifestAnnotateOpts) if err != nil { return err } - fmt.Printf("%s\n", updatedListID) + fmt.Println(id) return nil } |