helm-git
helm-git copied to clipboard
Sparse support for git 2.22
The plugin fails when ref
refers to an annotated tag, which is the usual case for GitHub release tags.
For example:
helm repo add istio git+https://github.com/istio/istio@install/kubernetes/helm?ref=1.1.4
Error in plugin 'helm-git': error Unable to pull. Check your git_ref and git_path.
(By the way, it would be nice if you included the parsed git_ref
and git_path
in your error message.)
Digging in deeper, I uncovered this error message:
error: cannot update ref 'refs/heads/1.1.4': trying to write non-commit object 5f41cee7af25cb717ecff9a6cb9d8cdf747437d2 to branch 'refs/heads/1.1.4'
which lead me to this StackOverflow post and this solution and a lot of extra info here. The problem is that the plugin is trying to do a git pull
into master
. The solution is to instead to git fetch
and then git checkout
, or maybe to do git clone
instead. (I am not a git expert and do not know the best way to get just the files you want. These are suggestions to help start further investigation.)
Thank you for reporting! I have to push an update that checkout the whole repo if the branch is not master. Haven't found any other way to reference a path that doesn't exists in the master branch when another branch is selected with sparse checkout. I let you know!
@aslafy-z I have found that git clone --depth 1 --branch <TAG>
works reliably to clone just the files at that tag. This SO answer suggest you can use file:///
to get just part of the repo after that.
definitely need this please!
As a workaround, you can add sparse=0
parameter at the end of your url to force clone the full repo before building chart.
(By the way, it would be nice if you included the parsed git_ref and git_path in your error message.)
@nuru you can get some more info when you do
export HELM_GIT_DEBUG=1
and run it again.
@aslafy-z This is more urgent now with the release of git
version 2.22
- The filter specification "--filter=sparse:path=
" used to create a lazy/partial clone has been removed. Using a blob that is part of the project as sparse specification is still supported with the "--filter=sparse:oid= " option.
Now I cannot even use a ref=SHA
to get around this issue.
Any progress on this?
I have no time to try and implement this feature. I'd love to review and merge any PR around this. I'll change position soon and hopefully will get more time.
@Nuru How are you currently continuing to use the helm-git plugin at this time? Did you just downgrade Git (as seen in above merge request) to keep that working?