summaryrefslogtreecommitdiff
path: root/cmd/podman/manifest/remove.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/manifest/remove.go')
-rw-r--r--cmd/podman/manifest/remove.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/cmd/podman/manifest/remove.go b/cmd/podman/manifest/remove.go
index c44c0991e..4716af201 100644
--- a/cmd/podman/manifest/remove.go
+++ b/cmd/podman/manifest/remove.go
@@ -1,7 +1,6 @@
package manifest
import (
- "context"
"fmt"
"github.com/containers/podman/v3/cmd/podman/common"
@@ -16,9 +15,9 @@ var (
Short: "Remove an entry from a manifest list or image index",
Long: "Removes an image from a manifest list or image index.",
RunE: remove,
+ Args: cobra.ExactArgs(2),
ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest remove mylist:v1.11 sha256:15352d97781ffdf357bf3459c037be3efac4133dc9070c2dce7eca7c05c3e736`,
- Args: cobra.ExactArgs(2),
}
)
@@ -30,18 +29,10 @@ func init() {
}
func remove(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().ManifestRemove(context.Background(), args)
+ updatedListID, err := registry.ImageEngine().ManifestRemoveDigest(registry.Context(), args[0], args[1])
if err != nil {
- return errors.Wrapf(err, "error removing from manifest list %s", listImageSpec)
+ return errors.Wrapf(err, "error removing from manifest list %s", args[0])
}
- fmt.Printf("%s\n", updatedListID)
+ fmt.Println(updatedListID)
return nil
}