Merge pull request #24955 from AdoHe/output_nil

fix config view output bug
This commit is contained in:
Robert Bailey 2016-05-06 14:49:43 -07:00
commit f01f9f2237

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)