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

@@ -563,8 +563,7 @@ func TestAnnotateLocal(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
cmd := NewCmdAnnotate(f, buf)
cmd.Flags().Set("local", "true")
options := &AnnotateOptions{}
options := &AnnotateOptions{local: true}
options.Filenames = []string{"../../../examples/storage/cassandra/cassandra-controller.yaml"}
args := []string{"a=b"}
if err := options.Complete(buf, cmd, args); err != nil {
@@ -618,8 +617,7 @@ func TestAnnotateMultipleObjects(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
cmd := NewCmdAnnotate(f, buf)
cmd.SetOutput(buf)
cmd.Flags().Set("all", "true")
options := &AnnotateOptions{}
options := &AnnotateOptions{all: true}
args := []string{"pods", "a=b", "c-"}
if err := options.Complete(buf, cmd, args); err != nil {
t.Fatalf("unexpected error: %v", err)