use of com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory in project quarkus by quarkusio.
the class JibProcessor method toRegistryImage.
private RegistryImage toRegistryImage(ImageReference imageReference, Optional<String> username, Optional<String> password) {
CredentialRetrieverFactory credentialRetrieverFactory = CredentialRetrieverFactory.forImage(imageReference, log::info);
RegistryImage registryImage = RegistryImage.named(imageReference);
if (username.isPresent() && password.isPresent()) {
registryImage.addCredential(username.get(), password.get());
} else {
registryImage.addCredentialRetriever(credentialRetrieverFactory.wellKnownCredentialHelpers());
registryImage.addCredentialRetriever(credentialRetrieverFactory.dockerConfig());
}
return registryImage;
}
Aggregations