kubectl: cannot set --all and --selector at the same time

This commit is contained in:
Di Xu
2017-08-25 16:28:21 +08:00
parent e8225f5618
commit e45117856e
11 changed files with 51 additions and 46 deletions

View File

@@ -417,9 +417,9 @@ func TestLabelLocal(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
cmd := NewCmdLabel(f, buf)
cmd.Flags().Set("local", "true")
opts := LabelOptions{FilenameOptions: resource.FilenameOptions{
Filenames: []string{"../../../examples/storage/cassandra/cassandra-controller.yaml"}}}
Filenames: []string{"../../../examples/storage/cassandra/cassandra-controller.yaml"}},
local: true}
err := opts.Complete(buf, cmd, []string{"a=b"})
if err == nil {
err = opts.Validate()
@@ -471,9 +471,7 @@ func TestLabelMultipleObjects(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
cmd := NewCmdLabel(f, buf)
cmd.Flags().Set("all", "true")
opts := LabelOptions{}
opts := LabelOptions{all: true}
err := opts.Complete(buf, cmd, []string{"pods", "a=b"})
if err == nil {
err = opts.Validate()