Merge pull request #44693 from xilabao/remove-incorrect-validate-in-create-role

Automatic merge from submit-queue

remove resourcename validation in create role

@liggitt Since #44659 is not correct. I think we should fix the validation in create role command.
This commit is contained in:
Kubernetes Submit Queue 2017-04-25 08:13:36 -07:00 committed by GitHub
commit 51fe7d2ba1
2 changed files with 1 additions and 6 deletions

View File

@ -207,11 +207,6 @@ func (c *CreateRoleOptions) Validate() error {
}
}
// validate resource names, can not apply resource names to multiple resources.
if len(c.ResourceNames) > 0 && len(c.Resources) > 1 {
return fmt.Errorf("resource name(s) can not be applied to multiple resources")
}
return nil
}

View File

@ -256,7 +256,7 @@ func TestValidate(t *testing.T) {
},
ResourceNames: []string{"foo"},
},
expectErr: true,
expectErr: false,
},
"test-valid-case": {
roleOptions: &CreateRoleOptions{