mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
Allow kubecfg to print custom types
This commit is contained in:
@@ -311,7 +311,7 @@ func executeAPIRequest(method string, s *kube_client.Client) bool {
|
||||
Template: tmpl,
|
||||
}
|
||||
default:
|
||||
printer = &kubecfg.HumanReadablePrinter{}
|
||||
printer = humanReadablePrinter()
|
||||
}
|
||||
|
||||
if err = printer.PrintObj(obj, os.Stdout); err != nil {
|
||||
@@ -369,3 +369,9 @@ func executeControllerRequest(method string, c *kube_client.Client) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func humanReadablePrinter() *kubecfg.HumanReadablePrinter {
|
||||
printer := kubecfg.NewHumanReadablePrinter()
|
||||
// Add Handler calls here to support additional types
|
||||
return printer
|
||||
}
|
||||
|
Reference in New Issue
Block a user