Split Runtime.pullRefPairsFromRefNames from Image.createNamesToPull

This will have another user shortly.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1112
Approved by: rhatdan
This commit is contained in:
Miloslav Trmač
2018-07-18 23:53:46 +02:00
committed by Atomic Bot
parent e20409d427
commit 4e285b52c1

View File

@ -320,11 +320,15 @@ func (i *Image) createNamesToPull() ([]*pullRefPair, error) {
pullNames = append(pullNames, &ps)
}
}
return i.imageruntime.pullRefPairsFromRefNames(pullNames)
}
// pullRefPairsFromNames converts a []*pullRefName to []*pullRefPair
func (ir *Runtime) pullRefPairsFromRefNames(pullNames []*pullRefName) ([]*pullRefPair, error) {
// Here we construct the destination references
res := make([]*pullRefPair, len(pullNames))
for j, pStruct := range pullNames {
destRef, err := is.Transport.ParseStoreReference(i.imageruntime.store, pStruct.dstName)
destRef, err := is.Transport.ParseStoreReference(ir.store, pStruct.dstName)
if err != nil {
return nil, errors.Wrapf(err, "error parsing dest reference name")
}