Search in sources :

Example 1 with CredentialRetrieverFactory

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;
}
Also used : CredentialRetrieverFactory(com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory) RegistryImage(com.google.cloud.tools.jib.api.RegistryImage)

Aggregations

RegistryImage (com.google.cloud.tools.jib.api.RegistryImage)1 CredentialRetrieverFactory (com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory)1