summaryrefslogtreecommitdiff
path: root/libpod/image/pull.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-20 17:05:05 +0200
committerGitHub <noreply@github.com>2019-07-20 17:05:05 +0200
commita5aa44c583612e210cf2ba44c3313a2ff27c94da (patch)
tree73ed4d954c4683eac127634300a0585c09a62412 /libpod/image/pull.go
parent8364552e1072c4fd9558a2be11d1ecb8546f51e1 (diff)
parent20302cb65d959e5ee966c69926753bb73c8242be (diff)
downloadpodman-a5aa44c583612e210cf2ba44c3313a2ff27c94da.tar.gz
podman-a5aa44c583612e210cf2ba44c3313a2ff27c94da.tar.bz2
podman-a5aa44c583612e210cf2ba44c3313a2ff27c94da.zip
Merge pull request #3610 from rhatdan/pullmsg
Cleanup Pull Message
Diffstat (limited to 'libpod/image/pull.go')
-rw-r--r--libpod/image/pull.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/libpod/image/pull.go b/libpod/image/pull.go
index 2f1d1e912..78cfe3626 100644
--- a/libpod/image/pull.go
+++ b/libpod/image/pull.go
@@ -240,6 +240,12 @@ func (ir *Runtime) pullImageFromReference(ctx context.Context, srcRef types.Imag
return ir.doPullImage(ctx, sc, *goal, writer, signingOptions, dockerOptions, nil)
}
+func cleanErrorMessage(err error) string {
+ errMessage := strings.TrimPrefix(errors.Cause(err).Error(), "errors:\n")
+ errMessage = strings.Split(errMessage, "\n")[0]
+ return fmt.Sprintf(" %s\n", errMessage)
+}
+
// doPullImage is an internal helper interpreting pullGoal. Almost everyone should call one of the callers of doPullImage instead.
func (ir *Runtime) doPullImage(ctx context.Context, sc *types.SystemContext, goal pullGoal, writer io.Writer, signingOptions SigningOptions, dockerOptions *DockerRegistryOptions, label *string) ([]string, error) {
span, _ := opentracing.StartSpanFromContext(ctx, "doPullImage")
@@ -281,9 +287,9 @@ func (ir *Runtime) doPullImage(ctx context.Context, sc *types.SystemContext, goa
_, err = cp.Image(ctx, policyContext, imageInfo.dstRef, imageInfo.srcRef, copyOptions)
if err != nil {
pullErrors = multierror.Append(pullErrors, err)
- logrus.Errorf("Error pulling image ref %s: %v", imageInfo.srcRef.StringWithinTransport(), err)
+ logrus.Debugf("Error pulling image ref %s: %v", imageInfo.srcRef.StringWithinTransport(), err)
if writer != nil {
- _, _ = io.WriteString(writer, "Failed\n")
+ _, _ = io.WriteString(writer, cleanErrorMessage(err))
}
} else {
if !goal.pullAllPairs {