kubectl-slice icon indicating copy to clipboard operation
kubectl-slice copied to clipboard

Add support for "--filter"

Open patrickdappollonio opened this issue 4 years ago • 1 comments

Akin to --include-kind and --include-name and their --exclude-* counterparts (as well as #22), for more complex case scenarios it might be worth providing some sort of filtering where an expression is passed, and if the expression evaluates to true, then the fields are selected, otherwise they're excluded.

A good idea would be to look at implementing Google's Common Expression Language

patrickdappollonio avatar Dec 01 '21 05:12 patrickdappollonio

Openly thinking about this, --filter would work differently than --include-* and --exclude-* since these can be passed multiple times, whereas filter, by having an expression, can fit any criteria.

Also thinking if #15 ever comes to life, there could be a place to add filtering right in the file, since a parameter might be just too large to put in a CLI call -- or won't look that pretty.

Open for thoughts from the community!

patrickdappollonio avatar Dec 01 '21 05:12 patrickdappollonio

After over a year with no comments on this, I'm inclined to close it.

If you have a need for something like this, please do open a new issue!

patrickdappollonio avatar Feb 20 '23 23:02 patrickdappollonio