mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #42612 from CaoShuFeng/create_role_trival
Automatic merge from submit-queue add "bind" to validResourceVerbs in "create role" cli "bind" and "impersonate" are also a legal verbs according this: https://github.com/kubernetes/kubernetes.github.io/pull/2771/files **Release note**: ```NONE ```
This commit is contained in:
commit
c289286647
@ -43,10 +43,10 @@ var (
|
||||
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
|
||||
|
||||
# Create a Role named "pod-reader" with ResourceName specified
|
||||
kubectl create role pod-reader --verb=get --verg=list --verb=watch --resource=pods --resource-name=readablepod`))
|
||||
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods --resource-name=readablepod`))
|
||||
|
||||
// Valid resource verb list for validation.
|
||||
validResourceVerbs = []string{"*", "get", "delete", "list", "create", "update", "patch", "watch", "proxy", "redirect", "deletecollection", "use"}
|
||||
validResourceVerbs = []string{"*", "get", "delete", "list", "create", "update", "patch", "watch", "proxy", "redirect", "deletecollection", "use", "bind", "impersonate"}
|
||||
)
|
||||
|
||||
type CreateRoleOptions struct {
|
||||
|
@ -203,11 +203,12 @@ func TestValidate(t *testing.T) {
|
||||
},
|
||||
"test-valid-case": {
|
||||
roleOptions: &CreateRoleOptions{
|
||||
Name: "my-role",
|
||||
Verbs: []string{"get", "list"},
|
||||
Name: "role-binder",
|
||||
Verbs: []string{"get", "list", "bind"},
|
||||
Resources: []schema.GroupVersionResource{
|
||||
{
|
||||
Resource: "pods",
|
||||
Resource: "roles",
|
||||
Group: "rbac.authorization.k8s.io",
|
||||
},
|
||||
},
|
||||
ResourceNames: []string{"foo"},
|
||||
|
Loading…
Reference in New Issue
Block a user