Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging for pulling base image #685

Merged
merged 3 commits into from
Jul 23, 2018
Merged

Improve logging for pulling base image #685

merged 3 commits into from
Jul 23, 2018

Conversation

briandealwis
Copy link
Member

This is sort of related to #620. This PR adds a little bit of logging around the PullBaseImageStep to notify the user that jib will retry when the initial unauthenticated pull fails.

[INFO] Building dependencies layer...
[INFO] Building resources layer...
[INFO] Building classes layer...
[INFO] Getting base image nonexistant/image with no auth...
[INFO] Trying again for nonexistant/image with auth...
[INFO] Retrieving registry credentials for registry.hub.docker.com…

Perhaps the "auth" is a bit too encoded.

buildConfiguration
.getBuildLogger()
.lifecycle(
"Trying again for " + buildConfiguration.getBaseImageReference() + " with auth...");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

"The base image repository requires auth. Trying again for ..."

.lifecycle(
"Getting base image "
+ buildConfiguration.getBaseImageReference()
+ " with no auth...");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the default case is gcr.io/distroless/java, I think we can leave off the with no auth here, and then below it can be what @chanseokoh recommended.

Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm also OK with "The base image requires auth. Trying again for <ref> with auth..."

@briandealwis
Copy link
Member Author

I'd rather include the image ref so that it's clear that the message is tied to the previous pull.

@briandealwis briandealwis merged commit d36ec2a into master Jul 23, 2018
@briandealwis briandealwis deleted the pulling branch July 23, 2018 16:11
@chanseokoh
Copy link
Member

chanseokoh commented Jul 23, 2018

Trying again for <ref> with auth..."

Gosh, I keep forgetting that I need to escape brackets, haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants