mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
remove resourcename validation in create role
This commit is contained in:
parent
ed539fb76f
commit
7bd9ddef60
@ -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
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ func TestValidate(t *testing.T) {
|
||||
},
|
||||
ResourceNames: []string{"foo"},
|
||||
},
|
||||
expectErr: true,
|
||||
expectErr: false,
|
||||
},
|
||||
"test-valid-case": {
|
||||
roleOptions: &CreateRoleOptions{
|
||||
|
Loading…
Reference in New Issue
Block a user