Merge pull request #60210 from deads2k/cli-12-showall

Automatic merge from submit-queue (batch tested with PRs 55637, 57461, 60268, 60290, 60210). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

deprecate --show-all

`--show-all` is a pod-only filter that only affects human-readable printing of pods and only from `kubectl get`.  It hides pods which are in a terminal state.  Even at the beginning this was questionable, since you often (usually?) want to see the pods that have failed: all happy pods are alike, but every unhappy pod is unhappy in its own way.  In addition, it only worked on human-readable printers.  Doing a `-o name` or `-o yaml` showed a different set of results!

Per the mailing list discussion here: https://groups.google.com/forum/#!topic/kubernetes-sig-cli/0SxgDxObxD0

```release-note
`--show-all` (which only affected pods and only for human readable/non-API printers) is now defaulted to true and deprecated.  It will be inert in 1.11 and removed in a future release.
```

/assign @adohe 
/assign @pwittrock 
/assign @soltysh 

@kubernetes/sig-cli-maintainers
This commit is contained in:
Kubernetes Submit Queue
2018-02-23 09:49:48 -08:00
committed by GitHub
2 changed files with 9 additions and 7 deletions

View File

@@ -386,14 +386,14 @@ func TestGetObjectsFiltered(t *testing.T) {
flags map[string]string
expect string
}{
{args: []string{"pods", "foo"}, flags: map[string]string{"show-all": "true"}, resp: first, expect: "pod/foo\n"},
{args: []string{"pods", "foo"}, resp: first, expect: "pod/foo\n"},
{args: []string{"pods", "foo"}, flags: map[string]string{"show-all": "false"}, resp: first, expect: "pod/foo\n"},
{args: []string{"pods"}, flags: map[string]string{"show-all": "true"}, resp: pods, expect: "pod/foo\npod/bar\n"},
{args: []string{"pods/foo"}, resp: first, expect: "pod/foo\n"},
{args: []string{"pods"}, flags: map[string]string{"output": "yaml"}, resp: pods, expect: "pod/bar\n"},
{args: []string{}, flags: map[string]string{"filename": "../../../../examples/storage/cassandra/cassandra-controller.yaml"}, resp: pods, expect: "pod/foo\npod/bar\n"},
{args: []string{"pods"}, resp: pods, expect: "pod/foo\npod/bar\n"},
{args: []string{"pods/foo"}, flags: map[string]string{"show-all": "false"}, resp: first, expect: "pod/foo\n"},
{args: []string{"pods"}, flags: map[string]string{"show-all": "false", "output": "yaml"}, resp: pods, expect: "pod/bar\n"},
{args: []string{}, flags: map[string]string{"show-all": "false", "filename": "../../../../examples/storage/cassandra/cassandra-controller.yaml"}, resp: pods, expect: "pod/foo\npod/bar\n"},
{args: []string{"pods"}, resp: pods, expect: "pod/bar\n"},
{args: []string{"pods"}, flags: map[string]string{"show-all": "false"}, resp: pods, expect: "pod/bar\n"},
{args: []string{"pods"}, flags: map[string]string{"show-all": "true", "output": "yaml"}, resp: pods, expect: "pod/foo\npod/bar\n"},
{args: []string{"pods"}, flags: map[string]string{"show-all": "false"}, resp: pods, expect: "pod/bar\n"},
}
@@ -991,6 +991,7 @@ func TestGetByFormatForcesFlag(t *testing.T) {
cmd := NewCmdGet(tf, buf, errBuf)
cmd.SetOutput(buf)
cmd.Flags().Lookup("output").Value.Set("yaml")
cmd.Flags().Set("show-all", "false")
cmd.Run(cmd, []string{"pods"})
showAllFlag, _ := cmd.Flags().GetBool("show-all")