I've recently learned about kubectl --field-selector
flag, but ran into errors when trying to use it with various objects.
For example :
$ kubectl delete jobs.batch --field-selector status.succeeded==1
Error from server (BadRequest): Unable to find "batch/v1, Resource=jobs" that match label selector "", field selector "status.succeeded==1": field label "status.succeeded" not supported for batchv1.Job
According to the documentation, Supported field selectors vary by Kubernetes resource type.
, so I guess this behaviour was to be expected.
The annoying part is that I had to try individually each field to know if I could use them or not.
Is there any way to get all the fields supported for a given resource type / resource version / kubectl version ?