diff options
-rw-r--r-- | .cirrus.yml | 11 | ||||
-rw-r--r-- | libpod/image/pull.go | 10 |
2 files changed, 13 insertions, 8 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index 70c3cb3da..578a3eef0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ env: #### #### Global variables used for all tasks #### - # Name of the ultimate destination branch for this build + # Name of the ultimate destination branch for this CI run, PR or post-merge. DEST_BRANCH: "master" # Overrides default location (/tmp/cirrus) for repo clone GOPATH: "/var/tmp/go" @@ -194,7 +194,6 @@ build_each_commit_task: - "vendor" - "varlink_api" - # $CIRRUS_BASE_BRANCH is only set when testing a PR only_if: $CIRRUS_BRANCH != $DEST_BRANCH && $CIRRUS_CHANGE_MESSAGE !=~ '.*\*\*\*\s*CIRRUS:\s*TEST\s*IMAGES\s*\*\*\*.*' @@ -210,9 +209,10 @@ build_each_commit_task: setup_environment_script: '$SCRIPT_BASE/setup_environment.sh |& ${TIMESTAMP}' build_each_commit_script: - - 'source $SCRIPT_BASE/lib.sh' - - 'git fetch --depth $CIRRUS_CLONE_DEPTH origin $CIRRUS_BASE_BRANCH |& ${TIMESTAMP}' - - 'make build-all-new-commits GIT_BASE_BRANCH=origin/$CIRRUS_BASE_BRANCH |& ${TIMESTAMP}' + # set -x by default, no need to spew contents of lib.sh + - 'source $SCRIPT_BASE/lib.sh &> /dev/null' + - 'git fetch --depth $CIRRUS_CLONE_DEPTH origin $DEST_BRANCH |& ${TIMESTAMP}' + - 'make build-all-new-commits GIT_BASE_BRANCH=origin/$DEST_BRANCH |& ${TIMESTAMP}' on_failure: failed_branch_script: '$CIRRUS_WORKING_DIR/$SCRIPT_BASE/notice_branch_failure.sh' @@ -225,7 +225,6 @@ build_without_cgo_task: - "vendor" - "varlink_api" - # $CIRRUS_BASE_BRANCH is only set when testing a PR only_if: $CIRRUS_BRANCH != $DEST_BRANCH && $CIRRUS_CHANGE_MESSAGE !=~ '.*\*\*\*\s*CIRRUS:\s*TEST\s*IMAGES\s*\*\*\*.*' 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 { |