summaryrefslogtreecommitdiff
path: root/libpod/image/utils.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-15 10:06:49 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-20 16:20:12 +0000
commit38a1b2f16d210525eafcc845e7a9cce598207113 (patch)
tree5616a12d68ebe55138fbde85f936a6bc90d4c8fd /libpod/image/utils.go
parentecfa321288f10b70a59166f93296c77d262317fc (diff)
downloadpodman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.gz
podman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.bz2
podman-38a1b2f16d210525eafcc845e7a9cce598207113.zip
Image library stage 4 - create and commit
Migrate the podman create and commit subcommandis to leverage the images library. I also had to migrate the cmd/ portions of run and rmi. Signed-off-by: baude <bbaude@redhat.com> Closes: #498 Approved by: mheon
Diffstat (limited to 'libpod/image/utils.go')
-rw-r--r--libpod/image/utils.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/libpod/image/utils.go b/libpod/image/utils.go
index adc795e3a..76ec349f9 100644
--- a/libpod/image/utils.go
+++ b/libpod/image/utils.go
@@ -2,15 +2,14 @@ package image
import (
"io"
+ "strings"
cp "github.com/containers/image/copy"
"github.com/containers/image/docker/reference"
- "github.com/containers/storage"
- "github.com/pkg/errors"
-
"github.com/containers/image/signature"
"github.com/containers/image/types"
- "strings"
+ "github.com/containers/storage"
+ "github.com/pkg/errors"
)
func getTags(nameInput string) (reference.NamedTagged, bool, error) {
@@ -36,14 +35,19 @@ func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, er
}
if d.name == search.name && d.tag == search.tag {
results = append(results, image.image)
- break
+ continue
+ }
+ // account for registry:/somedir/image
+ if strings.HasSuffix(d.name, search.name) && d.tag == search.tag {
+ results = append(results, image.image)
+ continue
}
}
}
if len(results) == 0 {
- return &storage.Image{}, errors.Errorf("unable to find a name and tag match for %s in repotags", search)
+ return &storage.Image{}, errors.Errorf("unable to find a name and tag match for %s in repotags", search.name)
} else if len(results) > 1 {
- return &storage.Image{}, errors.Errorf("found multiple name and tag matches for %s in repotags", search)
+ return &storage.Image{}, errors.Errorf("found multiple name and tag matches for %s in repotags", search.name)
}
return results[0], nil
}