Allow kubecfg to print custom types

This commit is contained in:
csrwng
2014-08-13 19:41:58 -04:00
parent 7c7273eed3
commit 14714f2638
3 changed files with 162 additions and 55 deletions

View File

@@ -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
}