helm-git icon indicating copy to clipboard operation
helm-git copied to clipboard

Feature: Support helm --username --password

Open Exchizz opened this issue 2 years ago • 6 comments
trafficstars

Hi,

I'm currently looking into using helm-git from ArgoCD. ArgoCD passes credentials to helm repositories using "helm repo add --username and --password). Currently helm-git does not support using credentials passed via helm repo add --username and --password

I think it would be possible to support using something like:

git -c credential.helper='!f() { sleep 1; echo "username=${GIT_USER}"; echo "password=${GIT_PASSWORD}"; }; f' pull

(Copied from https://stackoverflow.com/a/65705346/1493471)

If I managed to implement this in helm-git, would this be merged in ?

\Mathias

Exchizz avatar Mar 06 '23 11:03 Exchizz

Hello,

AFAIK, Helm does not forward these credentials to downloader plugins. If you find a way to do so, I'm pretty sure we can merge that to helm-git.

These bindings has to be made manually either in the URL like git+https://username:password@host/... (for HTTP/S endpoints) or using a credential helper as stated in https://github.com/aslafy-z/helm-git#note-on-git-authentication.

If you're using ArgoCD and reference this Helm chart within the Application CR, you don't need to use this plugin as you can directly reference Helm sources files and link credentials.

Let me know if you need additional details

aslafy-z avatar Mar 06 '23 15:03 aslafy-z

Hi, I've created a PR that implements support for helm to pass --username and --password to download plugins. https://github.com/helm/helm/pull/11878

If it gets merged in I will make a pull request to helm-git that supports either git credentials helper or your approach with username:password :)

Thanks.

Exchizz avatar Mar 06 '23 15:03 Exchizz

but argocd only support http, i would like to use git+ssh

vl-kp avatar Jun 01 '23 05:06 vl-kp

@vl-kp I'm pretty sure ArgoCD supports working with Git over SSH

aslafy-z avatar Jun 01 '23 07:06 aslafy-z

I want the valueFiles to support git over ssh, currently only http+https, i made it works after add id_rsa, but it doesn't full support my initial goal, anyway thanks for the answer

And i found helm-git doesn't support .. in the path, not sure if this should be supported

vl-kp avatar Jun 06 '23 14:06 vl-kp