use of com.google.cloud.tools.jib.registry.credentials.NonexistentServerUrlDockerCredentialHelperException in project jib by google.
the class RetrieveRegistryCredentialsStep method retrieveFromCredentialHelper.
/**
* Attempts to retrieve authorization for the registry using {@code
* docker-credential-[credentialHelperSuffix]}.
*/
@VisibleForTesting
@Nullable
Authorization retrieveFromCredentialHelper(String credentialHelperSuffix) throws NonexistentDockerCredentialHelperException, IOException {
buildConfiguration.getBuildLogger().info("Checking credentials from docker-credential-" + credentialHelperSuffix);
try {
Authorization authorization = dockerCredentialHelperFactory.withCredentialHelperSuffix(credentialHelperSuffix).retrieve();
logGotCredentialsFrom("docker-credential-" + credentialHelperSuffix);
return authorization;
} catch (NonexistentServerUrlDockerCredentialHelperException ex) {
buildConfiguration.getBuildLogger().info("No credentials for " + registry + " in docker-credential-" + credentialHelperSuffix);
return null;
}
}
Aggregations