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

[Gradle] Ability to specify absolute path of credential helper #925

Closed
anuraaga opened this issue Sep 3, 2018 · 5 comments
Closed

[Gradle] Ability to specify absolute path of credential helper #925

anuraaga opened this issue Sep 3, 2018 · 5 comments
Assignees
Milestone

Comments

@anuraaga
Copy link
Contributor

anuraaga commented Sep 3, 2018

Description of the issue:

Currently it is only possible to specify the credential helper suffix (e.g., gcr). This requires an executable docker-credential-gcr to be on the PATH. This manipulation of the PATH may not be ideal, i.e., to allow builds to be reproducible on multiple environments.

Expected behavior:
It is possible to specify the absolute path to a credential helper. I believejib-core already supports passing a java.nio.Path and it just needs to be exposed.

@chanseokoh
Copy link
Member

chanseokoh commented Sep 4, 2018

Hi @anuraaga,

Can you elaborate on what your exact use case is? Also, do you want this to be a configurable parameter in pom.xml or build.gradle that you want to check in in a VCS? Or is it OK if you can specify that in a command line? Do you just want to fix a location where docker-credential-gcr is located, or do you also need to be able to specify an arbitrary command name (i.e., not starting with docker-credential prefix)?

@anuraaga
Copy link
Contributor Author

anuraaga commented Sep 4, 2018

Hey - my use case is that a Gradle task automatically downloads the gcloud sdk and extracts it into a location under gradle.userHomeDir. This way users don't have to worry about downloading SDKs, etc, the build takes care of everything and a task like :gcloudLoginToCluster can execute the downloaded SDK's gcloud to generate kubeconfig, for example and jib should "just work". But in this case, the gcloud SDK, which includes docker-credential-gcr is not on the system PATH, it is managed by Gradle.

Being able to specify the exact path to the credential helper on a Gradle script would be great. From what I could tell, this might be trivial since this method in core exists that takes a Path.

https://github.com/GoogleContainerTools/jib/blob/master/jib-core/src/main/java/com/google/cloud/tools/jib/frontend/CredentialRetrieverFactory.java#L117

@coollog coollog added this to the v0.10.0 milestone Sep 6, 2018
@coollog
Copy link
Contributor

coollog commented Oct 10, 2018

I believe we can allow credHelper to be specified with a path to a credential helper executable (along with the credential helper suffix as we have now). The value specified would first check for existence as a file and then try to be used as a credential helper suffix.

@coollog
Copy link
Contributor

coollog commented Nov 9, 2018

Hi @anuraaga , we've released version 0.10.0 with the ability to set a full path as the credHelper!

@anuraaga
Copy link
Contributor Author

Thanks! Verified it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants