In a preflight/support bundle collector, can I see if there are any pods that match a label?

I’d like to create a preflight check that alerts users if one-or-more pod exist with the label component=workspace. I don’t care about the exact number, just so long as it’s greater than one.

My initial thought was to use Cluster Resources and then search in /cluster-resources/pods/<name>.json and then use the JSON compare - however, I can’t see how I can do a jq command in there.

I don’t believe I can use the deployment status analyzer as this is a pod that’s created directly (ie, not with a parent deployment/daemonset/statefulset).

I could use a regex command, although that runs the risk of the "component": "workspace" not being in the labels (that’s a very low chance, but not zero)

1 Like

not directly related but maybe an interesting conversation to incorporate here Ability to display informational values from a JSON file or jq query · Issue #731 · replicatedhq/troubleshoot · GitHub