The question you quoted was to list resources. To be able to list, the resource must support the listing. Based on official documentation:
kubectl api-resources --verbs=list,get # All resources that support the "list" and "get" request verbs
In the case of documentation, we have 2 verbs (list, get), you had one (list). The idea is for the command to return only those api-resources which handle list verb.
In conclusion, the --verb=list
flag was used to limit the results to only those that support the listing.
I could not figure out why it was necessary to show only the resources that support the list verb.
This solution is good if, for example, later you want to work on api-resources using only the list. If you would like to operate on a resource that does not support it, you will get an error similar to this:
kubectl list tokenreviews
error: unknown command "list" for "kubectl"
Did you mean this?
get
wait
To avoid this situation you can filter results before with the flag --verb=list
.