From 3d1449b2cccdf6c84248c82758b0850c971d05be Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Sat, 28 Jul 2018 08:45:11 +0200 Subject: RFC: Rename runtime.pullImage to runtime.pullImageFromHeuristicSource MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is similar to the PushImageToHeuristicDestination RFC. The goal is to be very explicit about which functions try to heuristically guess what is the expected format of the string. Not quite "shaming" the users, but making sure they stand out. RFC: - Is this at all acceptable? Desirable? Should not change behavior (but does not add unit tests). Signed-off-by: Miloslav Trmač Closes: #1176 Approved by: rhatdan --- libpod/image/image.go | 2 +- libpod/image/pull.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libpod/image') diff --git a/libpod/image/image.go b/libpod/image/image.go index 56fe58e7f..9447ec9e1 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 := ir.pullImage(ctx, name, writer, authfile, signaturePolicyPath, signingoptions, dockeroptions, forceSecure) + imageName, err := ir.pullImageFromHeuristicSource(ctx, name, writer, authfile, signaturePolicyPath, signingoptions, dockeroptions, forceSecure) if err != nil { return nil, errors.Wrapf(err, "unable to pull %s", name) } diff --git a/libpod/image/pull.go b/libpod/image/pull.go index 1a77d89c8..f3a10d94d 100644 --- a/libpod/image/pull.go +++ b/libpod/image/pull.go @@ -200,9 +200,9 @@ func (ir *Runtime) pullGoalFromImageReference(ctx context.Context, srcRef types. return ir.pullGoalFromGoalNames(goalNames) } -// pullImage pulls an image based on input name, which may involve from configured registries. +// pullImageFromHeuristicSource pulls an image based on inputName, which is heuristically parsed and may involve configured registries. // Use pullImageFromReference if the source is known precisely. -func (ir *Runtime) pullImage(ctx context.Context, inputName string, writer io.Writer, authfile, signaturePolicyPath string, signingOptions SigningOptions, dockerOptions *DockerRegistryOptions, forceSecure bool) ([]string, error) { +func (ir *Runtime) pullImageFromHeuristicSource(ctx context.Context, inputName string, writer io.Writer, authfile, signaturePolicyPath string, signingOptions SigningOptions, dockerOptions *DockerRegistryOptions, forceSecure bool) ([]string, error) { var goal pullGoal sc := GetSystemContext(signaturePolicyPath, authfile, false) srcRef, err := alltransports.ParseImageName(inputName) -- cgit v1.2.3-54-g00ecf