kustomize: kustomize 3.5.5 breaks installing ArgoCD from URL
With kustomize 3.5.4, the following command succeeds and produces the YAML as expected:
kustomize build 'github.com/argoproj/argo-cd//manifests/ha/cluster-install?ref=v1.5.2
With kustomize 3.5.5 I now get the following error when running the command:
$ kustomize build 'github.com/argoproj/argo-cd//manifests/ha/cluster-install?ref=v1.5.2'
Error: accumulating resources: accumulateFile "accumulating resources from '../namespace-install': evalsymlink failure on '/private/var/folders/0_/gjp5mdvn64lgly0qsrlzq1vc0000gp/T/namespace-install' : lstat /private/var/folders/0_/gjp5mdvn64lgly0qsrlzq1vc0000gp/T/namespace-install: no such file or directory", loader.New "Error loading ../namespace-install with git: url lacks host: ../namespace-install, dir: evalsymlink failure on '/private/var/folders/0_/gjp5mdvn64lgly0qsrlzq1vc0000gp/T/namespace-install' : lstat /private/var/folders/0_/gjp5mdvn64lgly0qsrlzq1vc0000gp/T/namespace-install: no such file or directory, get: invalid source string: ../namespace-install"
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 36 (28 by maintainers)
Commits related to this issue
- Work around go-getter issue See https://github.com/argoproj/argo-cd/issues/3814 Kustomize issue: https://github.com/kubernetes-sigs/kustomize/issues/2538 go-getter issue: https://github.com/hashicor... — committed to lentzi90/personal-cloud by lentzi90 4 years ago
- Work around go-getter issue See https://github.com/argoproj/argo-cd/issues/3814 Kustomize issue: https://github.com/kubernetes-sigs/kustomize/issues/2538 go-getter issue: https://github.com/hashicor... — committed to lentzi90/personal-cloud by lentzi90 4 years ago
@jameshochadel Hi James, thanks for the feedback. It looks like this is a go-getter issue. I have created issue here.
For your case, the problem is go-getter has bug with sub directory. Adding
httpsworks since go-getter fails withhttpsscheme as well (because it’s ambiguous I guess) and a normal git clone happens.And the reason for why @chancez can fix the issue by replace
//with/is go-getter doesn’t work when you are using/andrefat the same time. So actually there is a normal git clone as well.I am surprised that go-getter has these problems. I think we may need to clearly document the url pattern if we want to continue using go-getter.
@jameshochadel My speculation was correct. In
no-https.sh, go-getter finishes with no error and only download the path (currently,/and//work nearly same in go-getter, which is different from their doc). If you add https, the go-getter fails and kustomize will clone the entire repo.I think the issue is different from #2444. Kustomize has changed to use go-getter by default. From the documentation of go-getter:
So only
manifests/ha/cluster-installwill be copied and../namespace-installis not there. You can try to replace//with/.I think we’re talking about 2 different things. The problem I’m trying to highlight is that when you have a resource like
github.com/jameshochadel/kustomize-issue-2538//dev, whatgo-getterdoes is give you just thedevfolder hence resources like../basewill fail. The issue linked seems to just be fixing issues where it’s not parsing urls correctly, but in the end doesn’t change the behavior of only getting the subdirectory.What I instead usually want is to copy the whole repo
github.com/jameshochadel/kustomize-issue-2538and then build the kustomization at folderdev. This is how the cloner does it and that’s why putting in an invalidgo-getterurl works.I want to clarify because it all seems by chance that any of this works at all. Using
go-gettersyntax necessarily means that we are only getting the contents of a subdirectory (which does not work for anything that remotely uses the recommended kustomize project structure).The way I see it, there are a couple ways forward here:
go-getterand then the subdirectory we want to use inside what was copiedAs it is now, saying that kustomize uses
go-gettersyntax just causes confusion because actually using legitimatego-gettersyntax breaks anything that uses relative imports. This also means that whengo-getterstarts accepting more urls that it currently doesn’t now, we’ll run into this entire issue again ofkustomizebreaking relative imports.May be related to https://github.com/kubernetes-sigs/kustomize/issues/2494