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

v3.5.5 unable to reference remote resource via commit hash #2494

Closed
JTarasovic opened this issue May 15, 2020 · 10 comments
Closed

v3.5.5 unable to reference remote resource via commit hash #2494

JTarasovic opened this issue May 15, 2020 · 10 comments

Comments

@JTarasovic
Copy link

JTarasovic commented May 15, 2020

This minimal kustomization.yaml will build with v3.5.4 but errors in v3.5.5

resources:
- github.com/coreos/kube-prometheus?ref=5b9341cad
2020/05/15 14:37:30 Error cloning git repo: Cloning into '/tmp/kustomize-774769430'...
warning: Could not find remote branch 5b9341cad to clone.
fatal: Remote branch 5b9341cad not found in upstream origin
Error: accumulating resources: accumulateFile "accumulating resources from 'github.com/coreos/kube-prometheus?ref=5b9341cad': evalsymlink failure on '/home/jason/Development/forks/tmp/github.com/coreos/kube-prometheus?ref=5b9341cad' : lstat /home/jason/Development/forks/tmp/github.com: no such file or directory", loader.New "trouble cloning git repo https://github.com/coreos/kube-prometheus.git in /tmp/kustomize-774769430: exit status 128"
@sara4dev
Copy link

btw @JTarasovic I don't think it was downloading the specific sha in v3.5.4 also. It silently errors out and downloads the master branch always. I had to use the tag or branch to make it pin.

You can find more details here - #2072 (comment)

@JTarasovic
Copy link
Author

ahh. shoot. I saw what looks to be the same thing in #2444 as well.

@JTarasovic
Copy link
Author

Yeah, the problem currently is either that we assumed a ref is only a branch/tag or that -b takes a ref.

https://github.com/kubernetes-sigs/kustomize/blob/master/api/internal/git/cloner.go#L39

Unfortunately, neither is true.

@mr-karan
Copy link
Contributor

Yep, wasn't able to make it work with ?ref=branch/tag either. #2444 (comment)

@michaelgeorgeattard
Copy link

michaelgeorgeattard commented May 19, 2020

?ref=tag works in v3.5.4, tried an invalid tag and I get an error.

In v3.5.5 ?ref=tag does not work whether tag is valid or not.

#2444 (comment)

@RyanSquared
Copy link
Contributor

I think at some point kustomize may have moved from using go-getter ? The documentation here: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md states that it uses go-getter, which correctly clones and checks out.

@pwittrock
Copy link
Contributor

cc @monopole @seans3

@monopole
Copy link
Contributor

dupe of #2444, fix is in #2537, which is in v3.6.1

@JTarasovic
Copy link
Author

tested against master. looks good. thanks all!

@monopole
Copy link
Contributor

thanks for confirming!

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

No branches or pull requests

7 participants