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
08a030f4
Commit
08a030f4
authored
May 08, 2017
by
Kubernetes Submit Queue
Committed by
GitHub
May 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #45088 from xilabao/add-validate-in-create-rolebinding
Automatic merge from submit-queue add validate in create rolebinding
parents
446d8959
0c0a32d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
clusterrolebinding.go
pkg/kubectl/clusterrolebinding.go
+1
-1
rolebinding.go
pkg/kubectl/rolebinding.go
+1
-1
No files found.
pkg/kubectl/clusterrolebinding.go
View file @
08a030f4
...
@@ -132,7 +132,7 @@ func (s ClusterRoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, err
...
@@ -132,7 +132,7 @@ func (s ClusterRoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, err
}
}
for
_
,
sa
:=
range
sets
.
NewString
(
s
.
ServiceAccounts
...
)
.
List
()
{
for
_
,
sa
:=
range
sets
.
NewString
(
s
.
ServiceAccounts
...
)
.
List
()
{
tokens
:=
strings
.
Split
(
sa
,
":"
)
tokens
:=
strings
.
Split
(
sa
,
":"
)
if
len
(
tokens
)
!=
2
{
if
len
(
tokens
)
!=
2
||
tokens
[
0
]
==
""
||
tokens
[
1
]
==
""
{
return
nil
,
fmt
.
Errorf
(
"serviceaccount must be <namespace>:<name>"
)
return
nil
,
fmt
.
Errorf
(
"serviceaccount must be <namespace>:<name>"
)
}
}
clusterRoleBinding
.
Subjects
=
append
(
clusterRoleBinding
.
Subjects
,
rbac
.
Subject
{
clusterRoleBinding
.
Subjects
=
append
(
clusterRoleBinding
.
Subjects
,
rbac
.
Subject
{
...
...
pkg/kubectl/rolebinding.go
View file @
08a030f4
...
@@ -147,7 +147,7 @@ func (s RoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, error) {
...
@@ -147,7 +147,7 @@ func (s RoleBindingGeneratorV1) StructuredGenerate() (runtime.Object, error) {
}
}
for
_
,
sa
:=
range
sets
.
NewString
(
s
.
ServiceAccounts
...
)
.
List
()
{
for
_
,
sa
:=
range
sets
.
NewString
(
s
.
ServiceAccounts
...
)
.
List
()
{
tokens
:=
strings
.
Split
(
sa
,
":"
)
tokens
:=
strings
.
Split
(
sa
,
":"
)
if
len
(
tokens
)
!=
2
{
if
len
(
tokens
)
!=
2
||
tokens
[
1
]
==
""
{
return
nil
,
fmt
.
Errorf
(
"serviceaccount must be <namespace>:<name>"
)
return
nil
,
fmt
.
Errorf
(
"serviceaccount must be <namespace>:<name>"
)
}
}
roleBinding
.
Subjects
=
append
(
roleBinding
.
Subjects
,
rbac
.
Subject
{
roleBinding
.
Subjects
=
append
(
roleBinding
.
Subjects
,
rbac
.
Subject
{
...
...
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