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

Entry resources from kustomization.yaml supports only relative and absolute paths #254

Closed
mszostok opened this issue Aug 14, 2018 · 2 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation.

Comments

@mszostok
Copy link

mszostok commented Aug 14, 2018

Problem

The documentation is misleading. We can read that in the kustomization.yaml file under the resources entry we can have:

any format that kubectl -f allows, i.e. files, directories, URLs and globs.

Source:
https://github.com/kubernetes-sigs/kustomize/blob/v1.0.6/pkg/types/kustomization.go#L42-L45

but unfortunately, it's not true.

Here is a logic which loads the files from the resources entry:
https://github.com/kubernetes-sigs/kustomize/blob/v1.0.6/pkg/resmap/resmap.go#L154

and underlying/finally it always calls the ioutil.ReadFile from the standard library
https://github.com/kubernetes-sigs/kustomize/blob/v1.0.6/pkg/loader/fileloader.go#L104-L111

So URL will not be supported at all. Also, regex are also not supported, for example:

resources:
- ../rbac/*.yaml
- ../manager/*.yaml

In the kubectl the have more complex logic for handling that, see: https://github.com/kubernetes/kubernetes/blob/v1.11.2/pkg/kubectl/genericclioptions/resource/builder.go#L190-L196.

Tested version

Version: {KustomizeVersion:1.0.6 GitCommit:017c4ae0aa19195db2a51ecc5aa82c56a1f1c99b BuildDate:2018-08-10T16:45:55Z}

Expectation

The documentation is adjusted and present the correct state with some examples, or the logic from the kubectl is ported to the kustomize repo.

@Liujingfang1
Copy link
Contributor

@mszostok That is the intended behavior of Kusotmize. Directory and regex are not supported. The URL support will be added.

We will update the documentation to be precise and consistent with Kustomize behavior.

@Liujingfang1 Liujingfang1 added kind/documentation Categorizes issue or PR as related to documentation. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Aug 14, 2018
@pohly
Copy link
Contributor

pohly commented Apr 12, 2019

The URL support will be added.

Which issue tracks that? #923 is about bases, so that's different.

I've filed #923 in case that there really isn't already a tracking issue for the enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

3 participants