fix config view output bug

This commit is contained in:
AdoHe 2016-04-28 23:04:57 -04:00
parent a907794ce3
commit 6958db9c16

View File

@ -67,6 +67,10 @@ func NewCmdConfigView(out io.Writer, ConfigAccess ConfigAccess) *cobra.Command {
fmt.Printf("--output wide is not available in kubectl config view; reset to default output format (%s)\n\n", defaultOutputFormat)
cmd.Flags().Set("output", defaultOutputFormat)
}
if outputFormat == "" {
fmt.Printf("reset to default output format (%s) as --output is empty", defaultOutputFormat)
cmd.Flags().Set("output", defaultOutputFormat)
}
printer, _, err := cmdutil.PrinterForCommand(cmd)
cmdutil.CheckErr(err)