Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove resourcename validation in create role #44693

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/kubectl/cmd/create_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/create_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestValidate(t *testing.T) {
},
ResourceNames: []string{"foo"},
},
expectErr: true,
expectErr: false,
},
"test-valid-case": {
roleOptions: &CreateRoleOptions{
Expand Down