From e20409d42760b29eea757625f651b073cdf7dadc Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Wed, 18 Jul 2018 23:48:35 +0200 Subject: Rename nameToPull to pullRefName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We will use it not only in createNamesToPull, but also in getPullListFromRef soon. Should not change behavior. Signed-off-by: Miloslav Trmač Closes: #1112 Approved by: rhatdan --- libpod/image/pull.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libpod/image/pull.go b/libpod/image/pull.go index bf5b97ab3..31cf5f875 100644 --- a/libpod/image/pull.go +++ b/libpod/image/pull.go @@ -57,6 +57,13 @@ type pullRefPair struct { dstRef types.ImageReference } +// pullRefName records a prepared source reference and a destination name to try to pull (if not DockerArchive) or to pull all (if DockerArchive) +type pullRefName struct { + image string + srcRef types.ImageReference + dstName string +} + func (ir *Runtime) getPullRefPair(srcRef types.ImageReference, destName string) (*pullRefPair, error) { imgPart, err := decompose(destName) if err == nil && !imgPart.hasRegistry { @@ -257,18 +264,11 @@ func (i *Image) pullImage(ctx context.Context, writer io.Writer, authfile, signa return images, nil } -// nameToPull is a mapping between a resolved source and an expected store destination name (FIXME: clean up somehow?) -type nameToPull struct { - image string - srcRef types.ImageReference - dstName string -} - // createNamesToPull looks at a decomposed image and determines the possible // images names to try pulling in combination with the registries.conf file as well func (i *Image) createNamesToPull() ([]*pullRefPair, error) { var ( - pullNames []*nameToPull + pullNames []*pullRefName imageName string ) @@ -286,7 +286,7 @@ func (i *Image) createNamesToPull() ([]*pullRefPair, error) { if err != nil { return nil, errors.Wrapf(err, "unable to parse '%s'", i.InputName) } - ps := nameToPull{ + ps := pullRefName{ image: i.InputName, srcRef: srcRef, } @@ -312,7 +312,7 @@ func (i *Image) createNamesToPull() ([]*pullRefPair, error) { if err != nil { return nil, errors.Wrapf(err, "unable to parse '%s'", i.InputName) } - ps := nameToPull{ + ps := pullRefName{ image: decomposedImage.assemble(), srcRef: srcRef, } -- cgit v1.2.3-54-g00ecf