-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Kustomize unable to build remote base versioned with Git commit #2444
Comments
Your example should have the ref appended to the url with "?". For example: resources:
- git@gitlab.com:someName/k8s-bases.git/bases/golang/?ref=release-0.3
- https://github.someOrganization/someName/someRepo.git//base?ref=7c69acaca930ec40413cfee468d3f2e7af423e20 |
@ricochet it was a type in the description, but even with the "?" appended it does not work as expected |
@eam-cs - it doesn't download the specific sha in v3.5.4. It silently errors out and downloads the You can find more details here - #2072 (comment) |
Can confirm even with |
In |
does anyone have a proposed fix? |
This issue is introduced in the Git cloning process here. kustomize/api/internal/git/cloner.go Line 39 in 9e40cc1
In v3.5.4 the implementation was wrong because it reset the repo to FETCH_HEAD after checkout the ref. But in commit ae458d0, which is included in v3.5.5, it's wrong as well by hard-coding using branch name so commit hash doesn't work. The fix should be adding a |
We cannot use this option as well if we want to support checkout a commit hash. kustomize/api/internal/git/cloner.go Line 37 in 9e40cc1
|
Did a deeper research. Kustomize changed to use go-getter but the implementation has a bug. go-getter will try to update the directory if the directory has already existed (hashicorp/go-getter#114). Kustomize always creates the temporary directory before calling go-getter so the go-getter actually is not used (because the directory is not initialized as a git repo), in most cases I guess. Then the buggy git clone implementation is engaged as a backup mechanism. I will add a subdirectory in the temporary dir to make go-getter work. |
Got the issue in Error
Version
I can confirm Don't have the permission to reopen it, but it needs to be @monopole |
@mr-karan Currently Kustomize is using go-getter as default method to fetch remote resources. I am not sure whether go-getter has issue with gitlab URL. Can you try to use go-getter to download your repo to see is there an error? |
gitlab URL's are working for me with v3.6.1. Try this format: resources:
- git@gitlab.com:convoy/my/repo.git/bases/deployment?ref=develop |
Hi, I have 2 different repositories, in one I'm storing some overlays and in the other one, I have my base that all overlays use. I am currently versioning my base using the Git SHA1 hash in the commit. For example, I can build on the remote base as:
resources:
ref=7c69acaca930ec40413cfee468d3f2e7af423e20
However, the ref gets ignored. The latest base always is used even if I specify an older commit. Here https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md#url-format, it is mentioned we can use specific commits and that base will be used. Is this a Bug? I'm currently using kustomize version 3.5.4, but I believe the version should not matter and this behavior should work for any version as specified in the above link. I have tested this locally running "kustomize build" and have also deployed using ArgoCD which uses the same kustomize version. Argo is able to build but the same problem happens. Any help would be appreciated
The text was updated successfully, but these errors were encountered: