-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Does not authenticate pull unless the image requires authentication. #414
Conversation
|
||
Authorization registryCredentials = | ||
NonBlockingSteps.get(retrieveBaseRegistryCredentialsStep); | ||
return new Result(pullBaseImage(registryCredentials), registryCredentials); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe pullBaseImage
could just return a Result
instead of having to wrap the returned image in a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually I think that'd be good, though here it would mean just calling the new Result
in the returns in pullBaseImage
, but pullBaseImage
is intended to be a method that just pulls the base image using the credentials, whereas Result
is the result of the step as a whole. I'll add a javadoc for this method.
@@ -21,6 +21,8 @@ | |||
import com.google.cloud.tools.jib.async.NonBlockingSteps; | |||
import com.google.cloud.tools.jib.blob.Blobs; | |||
import com.google.cloud.tools.jib.builder.BuildConfiguration; | |||
import com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.Result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it is actually necessary for the class to use Result
as the template.
|
||
private static final String DESCRIPTION = "Pulling base image manifest"; | ||
|
||
/** Structure for the result returned by this step. */ | ||
static class Result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a more descriptive name?
Fixes #376
This improves build speed by ~500ms for default distroless base image.