summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-29 18:21:44 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-31 19:36:26 -0500
commit26644d7cb85d5935bb59c7891ac9a81d6092673c (patch)
tree5220c5eb01357e4dbc0c635b81d4623c3a5438ed /pkg/domain/infra/abi/images.go
parent6d36d05447fd594bedebea8a9a4366d348a78290 (diff)
downloadpodman-26644d7cb85d5935bb59c7891ac9a81d6092673c.tar.gz
podman-26644d7cb85d5935bb59c7891ac9a81d6092673c.tar.bz2
podman-26644d7cb85d5935bb59c7891ac9a81d6092673c.zip
podman v2 image tag and untag
add the ability to tag and untag images in podmanv2 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/images.go')
-rw-r--r--pkg/domain/infra/abi/images.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index ef2879246..38b6c151d 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -264,3 +264,28 @@ func (ir *ImageEngine) Pull(ctx context.Context, rawImage string, options entiti
// copy(report.Report.Id, id)
// return &report, nil
// }
+
+func (ir *ImageEngine) Tag(ctx context.Context, nameOrId string, tags []string, options entities.ImageTagOptions) error {
+ newImage, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId)
+ if err != nil {
+ return err
+ }
+ for _, tag := range tags {
+ if err := newImage.TagImage(tag); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+func (ir *ImageEngine) Untag(ctx context.Context, nameOrId string, tags []string, options entities.ImageUntagOptions) error {
+ newImage, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId)
+ if err != nil {
+ return err
+ }
+ for _, tag := range tags {
+ if err := newImage.UntagImage(tag); err != nil {
+ return err
+ }
+ }
+ return nil
+}