summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-01 16:10:10 +0200
committerGitHub <noreply@github.com>2020-04-01 16:10:10 +0200
commit82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc (patch)
treeb819be57459895e73ebcd0ae8a1b204df7ba4849 /pkg/domain/infra/abi/images.go
parent394f1c26d61cc8570b49444e1f431978bf101daa (diff)
parent26644d7cb85d5935bb59c7891ac9a81d6092673c (diff)
downloadpodman-82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc.tar.gz
podman-82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc.tar.bz2
podman-82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc.zip
Merge pull request #5656 from baude/v2imagetag
podman v2 image tag and untag
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
+}