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

Allow using Google application default credentials for Artifact Registry #1167

Conversation

drohwer89
Copy link
Contributor

@drohwer89 drohwer89 commented Jul 26, 2024

With GoogleContainerTools/jib#1902 and GoogleContainerTools/jib#3241 JIB is able to use Google Application Default Credentials for authenticating against Google Container Registry and Google Artifact Registry.

Therefore the CredentialRetriever googleApplicationDefaultCredentials was implemented in CredentiaReceiver. At the moment, only the CredentialRetriever wellKnownCredentialHelpers is used in micornaut-maven-plugin. The googleApplicationDefaultCredentials CredentialRetriever isn't used at the moment. Therefor Google Application Default Credentials cannot be used for authenticating against Google Container Registry and Google Artifact Registry.

This PR fixes this issue.

At fixing this issue I ran into the problem, that Guava 19 is a transitive dependency of com.github.docker-java:docker-java-core .
There are also version 32.1.2 (transitive dependency of com.google.cloud.tools:jib-maven-plugin) and version 33.2.1 (transitive dependency of org.apache.maven:maven-core) in the classpath. Guava 19 seems to be a problem, because java.lang.NoSuchMethodError: 'long com.google.common.io.ByteStreams.exhaust(java.io.InputStream)' is thrown, when googleCredentials.refreshIfExpired() in googleApplicationDefaultCredentials is called. After excluding Guava 19 everything works fine for me.

@CLAassistant
Copy link

CLAassistant commented Jul 26, 2024

CLA assistant check
All committers have signed the CLA.

@alvarosanchez alvarosanchez added the type: improvement A minor improvement to an existing feature label Jul 29, 2024
@alvarosanchez alvarosanchez added this pull request to the merge queue Jul 29, 2024
Merged via the queue into micronaut-projects:4.6.x with commit e5176b6 Jul 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants