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

Kustomize doesn't fetch YAML from HTTPS URLs #2068

Closed
jpeach opened this issue Jan 10, 2020 · 13 comments
Closed

Kustomize doesn't fetch YAML from HTTPS URLs #2068

jpeach opened this issue Jan 10, 2020 · 13 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@jpeach
Copy link

jpeach commented Jan 10, 2020

Based on the documentation , I was expecting that I could use a https:// URL as a YAML resource, but kustomize doesn't seem to find it (or doesn't follow the GitHub redirects?).

$ cat kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/knative/serving/releases/download/v0.11.0/serving-crds.yaml
- https://github.com/knative/serving/releases/download/v0.11.0/serving-core.yaml
$ kustomize build .
2020/01/10 16:29:09 evalsymlink failure on '/private/var/folders/d9/tpzrvxbs7s98zqy4c5yq8bk40000gr/T/kustomize-632648700/releases/download/v0.11.0/serving-crds.yaml' : lstat /private/var/folders/d9/tpzrvxbs7s98zqy4c5yq8bk40000gr/T/kustomize-632648700/releases: no such file or directory
Error: accumulating resources: accumulating resources from 'https://github.com/knative/serving/releases/download/v0.11.0/serving-crds.yaml': evalsymlink failure on '/Users/jpeach/src/kustomize/knative/base/https:/github.com/knative/serving/releases/download/v0.11.0/serving-crds.yaml' : lstat /Users/jpeach/src/kustomize/knative/base/https:: no such file or directory
$ kustomize version
{Version:3.5.3 GitCommit:5ba90fe5ef1dc4599e359edd41d1d0e6373b247d BuildDate:2019-12-18T03:07:49+00:00 GoOs:darwin GoArch:amd64}
@yujunz
Copy link
Member

yujunz commented Jan 10, 2020

AFAIK, remote target is limited to a few git repo URL scheme.

You may have a look at https://github.com/kubernetes-sigs/kustomize/blob/master/examples/goGetterGeneratorPlugin.md for your use case.

@piyushGoyal2
Copy link

piyushGoyal2 commented Jan 10, 2020

+1 .
We also want to segregate sidecars and init containers common across applications. We were planning to have following section in all applications base folders with Kustomization.yaml having

patches:

  • path: patchSidecarSplunk.yaml
    target:
    kind: Deployment

but referring to one single file based on Github URL doesn't seem possible.

@yujunz

@jpeach
Copy link
Author

jpeach commented Jan 10, 2020

I was reading this documentation, which made me think that all kinds of go-getter URLs were supported generally.

So this sounds like "behaves correctly"?

@yujunz
Copy link
Member

yujunz commented Jan 11, 2020

@jpeach the documents says all url should be go-getter conformant. But not all go-getter url are supported. Related discussion in #923

@yujunz
Copy link
Member

yujunz commented Jan 11, 2020

@piyushGoyal2 you are right about single file cannot be referenced

We may play some trick in go-getter plugin to make it work for generator

https://github.com/kubernetes-sigs/kustomize/blob/master/plugin/someteam.example.com/v1/gogetter/GoGetter_test.go#L72

But it does not apply for transformers like patches.

@piyushGoyal2
Copy link

piyushGoyal2 commented Jan 13, 2020

@yujunz - Does it always look out for kustomization.yaml in remote repository? My assumption was that using go-getter, it just clones the repo as a sub directory in the current folder and then rest of the kustomize logic applies on top of it. Maybe I don't need to download particular files. I could clone the remote repository with sub folders and then give the path of cloned repo sub folder to include in the patches.

Looks like a pretty strong use case to me. What would you suggest?

@yujunz
Copy link
Member

yujunz commented Jan 13, 2020

The go-getter plugin does not expect kustomization, you may override the command.

The builtin resource generator does looking for a directory with kustomization.yaml file.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 12, 2020
@daurnimator
Copy link

I would expect to be able to reference a remote resource.

@yujunz
Copy link
Member

yujunz commented May 26, 2020

I would expect to be able to reference a remote resource.

It should be supported in version >3.5.5 now.

@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants