flant / shell-operator

Shell-operator is a tool for running event-driven scripts in a Kubernetes cluster

Home Page:https://flant.github.io/shell-operator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Annotation based selector

mhkarimi1383 opened this issue · comments

I want to select Secret and ConfigMap based on their annotations

Is your feature request related to a problem? Please describe.

If I select all of the ConfigMaps and handle my job by an if that compares annotations I have to handle lots of resources and that's not efficient.

Describe the solution you'd like to see

Extra field for annotation selector that will do something like this

but instead of returning some values return all of them

kubectl get service -A -o jsonpath='{range .items[?(@.metadata.annotations.prometheus\.io/scrape=="true")]}{ .metadata.namespace },{ .metadata.name}{"\n"}{end}'

Describe alternatives you've considered

Watching for all of them, select them if annotation set by using if

Additional context