mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
do not filter kubectl get pods if -o json or yaml
This patch sets the value of --show-all to true if the output format specified is 'json' or 'yaml'.
This commit is contained in:
parent
1bfd4f0a71
commit
cade00e646
@ -187,8 +187,11 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(options.Filenames) > 0 || argsHasNames {
|
||||
cmd.Flag("show-all").Value.Set("true")
|
||||
output := cmdutil.GetFlagString(cmd, "output")
|
||||
if len(options.Filenames) > 0 || argsHasNames || output == "json" || output == "yaml" {
|
||||
if !cmd.Flag("show-all").Changed {
|
||||
cmd.Flag("show-all").Value.Set("true")
|
||||
}
|
||||
}
|
||||
export := cmdutil.GetFlagBool(cmd, "export")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user