mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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:
commit
51fe7d2ba1
@ -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