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
9710eb62
Commit
9710eb62
authored
May 22, 2017
by
Cao Shufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate oidc flags
This change validate oidc flags for kube-apiserver.
parent
f0e5a999
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
validation.go
cmd/kube-apiserver/app/options/validation.go
+3
-0
authentication.go
pkg/kubeapiserver/options/authentication.go
+6
-0
No files found.
cmd/kube-apiserver/app/options/validation.go
View file @
9710eb62
...
@@ -60,6 +60,9 @@ func (options *ServerRunOptions) Validate() []error {
...
@@ -60,6 +60,9 @@ func (options *ServerRunOptions) Validate() []error {
if
errs
:=
options
.
SecureServing
.
Validate
();
len
(
errs
)
>
0
{
if
errs
:=
options
.
SecureServing
.
Validate
();
len
(
errs
)
>
0
{
errors
=
append
(
errors
,
errs
...
)
errors
=
append
(
errors
,
errs
...
)
}
}
if
errs
:=
options
.
Authentication
.
Validate
();
len
(
errs
)
>
0
{
errors
=
append
(
errors
,
errs
...
)
}
if
errs
:=
options
.
InsecureServing
.
Validate
(
"insecure-port"
);
len
(
errs
)
>
0
{
if
errs
:=
options
.
InsecureServing
.
Validate
(
"insecure-port"
);
len
(
errs
)
>
0
{
errors
=
append
(
errors
,
errs
...
)
errors
=
append
(
errors
,
errs
...
)
}
}
...
...
pkg/kubeapiserver/options/authentication.go
View file @
9710eb62
...
@@ -163,8 +163,14 @@ func (s *BuiltInAuthenticationOptions) WithWebHook() *BuiltInAuthenticationOptio
...
@@ -163,8 +163,14 @@ func (s *BuiltInAuthenticationOptions) WithWebHook() *BuiltInAuthenticationOptio
return
s
return
s
}
}
// Validate checks invalid config combination
func
(
s
*
BuiltInAuthenticationOptions
)
Validate
()
[]
error
{
func
(
s
*
BuiltInAuthenticationOptions
)
Validate
()
[]
error
{
allErrors
:=
[]
error
{}
allErrors
:=
[]
error
{}
if
s
.
OIDC
!=
nil
&&
(
len
(
s
.
OIDC
.
IssuerURL
)
>
0
)
!=
(
len
(
s
.
OIDC
.
ClientID
)
>
0
)
{
allErrors
=
append
(
allErrors
,
fmt
.
Errorf
(
"oidc-issuer-url and oidc-client-id should be specified together"
))
}
return
allErrors
return
allErrors
}
}
...
...
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