Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): recursive resource management kubernetes
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Feature request
I think it would be nice if we could specify a wildcard or regex when using kubectl [command] -f --recursive, like: kubectl apply -f . -R --regex *-resources.yml, so kubectl wouldn't try to parse other .yml files on file tree.
Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Environment:
uname -a): 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64What happened:
When I tried to apply some configs using the --recursive option, kubectl tried to parse some other .yml files on my file tree.
What you expected to happen:
I expected an option that allowed me to specify what files I should ignore or lookup for.
How to reproduce it (as minimally and precisely as possible):
kubectl apply -f . -R in any directory that has kubernetes resource manifests and other .yml or .json files.
Anything else we need to know:
rather than building complex file finding function into kubectl, I'd recommend combining with a more powerful tool like find and piping the results to kubectl:
find . -name *-resources.yml | xargs -n 1 kubectl apply -f
Most helpful comment
rather than building complex file finding function into kubectl, I'd recommend combining with a more powerful tool like
findand piping the results to kubectl: