Add support for "--include" and "--exclude"
patrickdappollonio opened this issue · 0 comments
patrickdappollonio commented
Now that --include-kind
and --include-name
and their --exclude-*
counterparts are in, as well as supporting globs on either of them, I should add:
--include
: to include any resource based on the format${kind}/${name}
--exclude
: to do the opposite
That way, you can do any of these queries:
kubectl-slice --include "deployment/*"
kubectl-slice --exclude "configmap/tekton-*"
kubectl-slice --include "deployments/*"
As a thing to note, it will always be ${kind}/${name}
, and still TBD whether I parse ${kind}
by itself, then ${name}
or we treat the string as a whole. With the first case, this wouldn't be possible:
--include "deployment*"
It will fail because there is no /
separator. It will probably be better, because otherwise the example right above could capture, say, a CRD named DeploymentConfig
(since the wildcard doesn't include an "end-of-word")