Skip to content

Commit

Permalink
Error deleting source archive should not fail GCB build
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis committed May 21, 2021
1 parent ff5038a commit b79e0cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/skaffold/build/gcb/cloud_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (b *Builder) buildArtifactWithCloudBuild(ctx context.Context, out io.Writer
}

if err := sources.UploadToGCS(ctx, c, artifact, cbBucket, buildObject, dependencies); err != nil {
return "", fmt.Errorf("uploading source tarball: %w", err)
return "", fmt.Errorf("uploading source archive: %w", err)
}

buildSpec, err := b.buildSpec(artifact, tag, cbBucket, buildObject)
Expand Down Expand Up @@ -193,9 +193,10 @@ watch:
}

if err := c.Bucket(cbBucket).Object(buildObject).Delete(ctx); err != nil {
return "", fmt.Errorf("cleaning up source tar after build: %w", err)
logrus.Warnf("Unable to deleting source archive after build: %q: %v", buildObject, err)
} else {
logrus.Infof("Deleted source archive %s", buildObject)
}
logrus.Infof("Deleted object %s", buildObject)

return build.TagWithDigest(tag, digest), nil
}
Expand Down

0 comments on commit b79e0cb

Please sign in to comment.