mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #24955 from AdoHe/output_nil
fix config view output bug
This commit is contained in:
commit
f01f9f2237
@ -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)
|
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)
|
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)
|
printer, _, err := cmdutil.PrinterForCommand(cmd)
|
||||||
cmdutil.CheckErr(err)
|
cmdutil.CheckErr(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user