summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2018-07-28 06:54:34 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-01 18:22:59 +0000
commit2d5410d3496096ed2022a872b413a58ceee9fb98 (patch)
tree02d4bce1de4dbc07ded2788acb7ee0c9b4416275 /libpod/image/image.go
parentdbe2395769933a53058e81386f8f7a072acd15a2 (diff)
downloadpodman-2d5410d3496096ed2022a872b413a58ceee9fb98.tar.gz
podman-2d5410d3496096ed2022a872b413a58ceee9fb98.tar.bz2
podman-2d5410d3496096ed2022a872b413a58ceee9fb98.zip
Move pullImage from Image to Runtime
pullImage (now) only uses Image.InputName; it is really used to _create_ an Image object, based on the pull results (as is most visible in the LoadFromArchive caller), so it should not be a method on it. This also simplifies a bit the number of different kids of uses of Image.InputName; still apparently not enough to clearly document the field, though. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1176 Approved by: rhatdan
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index d07412d9c..5b38a7c1d 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -145,7 +145,7 @@ func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile
if signaturePolicyPath == "" {
signaturePolicyPath = ir.SignaturePolicyPath
}
- imageName, err := newImage.pullImage(ctx, writer, authfile, signaturePolicyPath, signingoptions, dockeroptions, forceSecure)
+ imageName, err := ir.pullImage(ctx, name, writer, authfile, signaturePolicyPath, signingoptions, dockeroptions, forceSecure)
if err != nil {
return nil, errors.Wrapf(err, "unable to pull %s", name)
}
@@ -163,16 +163,11 @@ func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile
// This function is needed because it is possible for a tar archive to have multiple tags for one image
func (ir *Runtime) LoadFromArchive(ctx context.Context, name, signaturePolicyPath string, writer io.Writer) ([]*Image, error) {
var newImages []*Image
- newImage := Image{
- InputName: name,
- Local: false,
- imageruntime: ir,
- }
if signaturePolicyPath == "" {
signaturePolicyPath = ir.SignaturePolicyPath
}
- imageNames, err := newImage.pullImage(ctx, writer, "", signaturePolicyPath, SigningOptions{}, &DockerRegistryOptions{}, false)
+ imageNames, err := ir.pullImage(ctx, name, writer, "", signaturePolicyPath, SigningOptions{}, &DockerRegistryOptions{}, false)
if err != nil {
return nil, errors.Wrapf(err, "unable to pull %s", name)
}