how to deal with nested assets #1533
-
When I use local querypacks I wonder how to deal with nested assets. I want to discover only a subset of assets in a Kubernetes cluster. The following does not work as expected:
Expected behaviour: only show cluster related assets, not all others (including daemonsets). The above command produces a lot of unnecessary outputs, like this:
My YAML file contains also the following
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I just tested it with the query pack:
and it worked as expected. Be aware that the discover flag needs to be For the asset filter you only need the following filter: filters:
- asset.platform == "k8s-cluster" We use both filters in the query packs to be compatible with older versions of cnquery. If you are on the latest version you do not need to have that special handling. |
Beta Was this translation helpful? Give feedback.
I just tested it with the query pack:
and it worked as expected. Be aware that the discover flag needs to be
--discover clusters
.For the asset filter you only need the following filter:
We use both filters in the query packs to be compatible with older versions of cnquery. If you are on the latest version you do not need to have that special handling.