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'.
pull/6/head
juanvallejo 2016-12-20 15:35:28 -05:00
parent 1bfd4f0a71
commit cade00e646
No known key found for this signature in database
GPG Key ID: 7D2C958002D6448D
1 changed files with 5 additions and 2 deletions

View File

@ -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")