* Add JSON & YAML output support for kubectl api-resources
Create a separate `PrintFlags` struct within the apiresources.go file
that handles printing only for `kubetl api-resources` because existing
output formats, i.e., wide and name, are already implemented
independently from HumanReadableFlags and NamePrintFlags.
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Use separate printer type for all options
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Unit tests for JSON & YAML outputs
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Separate file for print types
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Move JSON-YAML tests to separate function
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Fix broken unit test
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Unifying JSON & YAML unit test functions
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Fix linter errors
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* PR feedback and linter again
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
---------
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Kubernetes-commit: cb33accc8fc4d44e902da4926eee7b828c5e51ec
This PR changes `kubectl apiresources` command by using restclientgetter
instead of cmdutil.Factory for loose coupling and a couple of minor refactorings.
This PR also unleashes migration of other commands depending on apiresources
via completion.
Kubernetes-commit: 50c93bfe04557eccb38b46cc4b99a6a3ec13f85b
Add categories column to show which categories each
resource type belongs to.
Add --categories flag to allow filtering the output to
a specific category or set of categories.
Change verbs column to display verbs in a comma-delimited
list, consistent with other multi-value columns in the output.
Kubernetes-commit: a1330a405497479ea30319258e75435ba8321d61