summaryrefslogtreecommitdiff
path: root/libpod/image/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/image/pull.go')
-rw-r--r--libpod/image/pull.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/libpod/image/pull.go b/libpod/image/pull.go
index f7131f11e..bbabba7b9 100644
--- a/libpod/image/pull.go
+++ b/libpod/image/pull.go
@@ -84,8 +84,8 @@ func getPullRefName(srcRef types.ImageReference, destName string) (*pullRefName,
}, nil
}
-// returns a list of pullRefPair with the srcRef and DstRef based on the transport being used
-func (ir *Runtime) getPullListFromRef(ctx context.Context, srcRef types.ImageReference, imgName string, sc *types.SystemContext) ([]*pullRefPair, error) {
+// refNamesFromImageReference returns a list of pullRefName for a single ImageReference, depending on the used transport.
+func refNamesFromImageReference(ctx context.Context, srcRef types.ImageReference, imgName string, sc *types.SystemContext) ([]*pullRefName, error) {
var pullNames []*pullRefName
splitArr := strings.Split(imgName, ":")
archFile := splitArr[len(splitArr)-1]
@@ -178,8 +178,17 @@ func (ir *Runtime) getPullListFromRef(ctx context.Context, srcRef types.ImageRef
}
pullNames = append(pullNames, pullInfo)
}
+ return pullNames, nil
+}
+
+// getPullListFromRef returns a list of pullRefPair for a single ImageReference, depending on the used transport.
+func (ir *Runtime) getPullListFromRef(ctx context.Context, srcRef types.ImageReference, imgName string, sc *types.SystemContext) ([]*pullRefPair, error) {
+ refNames, err := refNamesFromImageReference(ctx, srcRef, imgName, sc)
+ if err != nil {
+ return nil, err
+ }
- return ir.pullRefPairsFromRefNames(pullNames)
+ return ir.pullRefPairsFromRefNames(refNames)
}
// pullImage pulls an image from configured registries