Andres Caro:
let’s say we have several nodes, and we want to know the names that have taints on them, the following command would do the job:
k get no -o jsonpath='{.items[?(@.spec.taints[*].key)].metadata.name}'
But how to do the opposite? (filter the nodes that don’t have taints on them)
What I did is adding the !
before the @
to negate the filter, but I’m getting an error:
error: error parsing jsonpath {.items[?(!@.spec.taints[*].key)].metadata.name}, unrecognized character in action: U+0021 '!'
What is the right approach to do it?