Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
877bf544
Commit
877bf544
authored
Mar 07, 2017
by
Cao Shufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add "bind" and "impersonate" to legal verbs
"bind" and "impersonate" are also legal verbs according this:
https://github.com/kubernetes/kubernetes.github.io/pull/2771/files
parent
357af077
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
create_role.go
pkg/kubectl/cmd/create_role.go
+2
-2
create_role_test.go
pkg/kubectl/cmd/create_role_test.go
+4
-3
No files found.
pkg/kubectl/cmd/create_role.go
View file @
877bf544
...
@@ -43,10 +43,10 @@ var (
...
@@ -43,10 +43,10 @@ var (
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
# Create a Role named "pod-reader" with ResourceName specified
# Create a Role named "pod-reader" with ResourceName specified
kubectl create role pod-reader --verb=get --ver
g
=list --verb=watch --resource=pods --resource-name=readablepod`
))
kubectl create role pod-reader --verb=get --ver
b
=list --verb=watch --resource=pods --resource-name=readablepod`
))
// Valid resource verb list for validation.
// 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
{
type
CreateRoleOptions
struct
{
...
...
pkg/kubectl/cmd/create_role_test.go
View file @
877bf544
...
@@ -203,11 +203,12 @@ func TestValidate(t *testing.T) {
...
@@ -203,11 +203,12 @@ func TestValidate(t *testing.T) {
},
},
"test-valid-case"
:
{
"test-valid-case"
:
{
roleOptions
:
&
CreateRoleOptions
{
roleOptions
:
&
CreateRoleOptions
{
Name
:
"
my-role
"
,
Name
:
"
role-binder
"
,
Verbs
:
[]
string
{
"get"
,
"list"
},
Verbs
:
[]
string
{
"get"
,
"list"
,
"bind"
},
Resources
:
[]
schema
.
GroupVersionResource
{
Resources
:
[]
schema
.
GroupVersionResource
{
{
{
Resource
:
"pods"
,
Resource
:
"roles"
,
Group
:
"rbac.authorization.k8s.io"
,
},
},
},
},
ResourceNames
:
[]
string
{
"foo"
},
ResourceNames
:
[]
string
{
"foo"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment