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
606feff2
Commit
606feff2
authored
Aug 01, 2016
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify if Secure and InsecurePort are equal for apiserver
parent
31da82df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
genericapiserver.go
pkg/genericapiserver/genericapiserver.go
+7
-6
No files found.
pkg/genericapiserver/genericapiserver.go
View file @
606feff2
...
@@ -585,25 +585,26 @@ func verifyEtcdServersList(options *options.ServerRunOptions) {
...
@@ -585,25 +585,26 @@ func verifyEtcdServersList(options *options.ServerRunOptions) {
}
}
}
}
func
verifySecurePort
(
options
*
options
.
ServerRunOptions
)
{
func
verifySecure
AndInsecure
Port
(
options
*
options
.
ServerRunOptions
)
{
if
options
.
SecurePort
<
0
||
options
.
SecurePort
>
65535
{
if
options
.
SecurePort
<
0
||
options
.
SecurePort
>
65535
{
glog
.
Fatalf
(
"--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port."
,
options
.
SecurePort
)
glog
.
Fatalf
(
"--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port."
,
options
.
SecurePort
)
}
}
}
// TODO: Allow 0 to turn off insecure port.
// TODO: Allow 0 to turn off insecure port.
func
verifyInsecurePort
(
options
*
options
.
ServerRunOptions
)
{
if
options
.
InsecurePort
<
1
||
options
.
InsecurePort
>
65535
{
if
options
.
InsecurePort
<
1
||
options
.
InsecurePort
>
65535
{
glog
.
Fatalf
(
"--insecure-port %v must be between 1 and 65535, inclusive."
,
options
.
InsecurePort
)
glog
.
Fatalf
(
"--insecure-port %v must be between 1 and 65535, inclusive."
,
options
.
InsecurePort
)
}
}
if
options
.
SecurePort
==
options
.
InsecurePort
{
glog
.
Fatalf
(
"--secure-port and --insecure-port cannot use the same port."
)
}
}
}
func
ValidateRunOptions
(
options
*
options
.
ServerRunOptions
)
{
func
ValidateRunOptions
(
options
*
options
.
ServerRunOptions
)
{
verifyClusterIPFlags
(
options
)
verifyClusterIPFlags
(
options
)
verifyServiceNodePort
(
options
)
verifyServiceNodePort
(
options
)
verifyEtcdServersList
(
options
)
verifyEtcdServersList
(
options
)
verifySecurePort
(
options
)
verifySecureAndInsecurePort
(
options
)
verifyInsecurePort
(
options
)
}
}
func
DefaultAndValidateRunOptions
(
options
*
options
.
ServerRunOptions
)
{
func
DefaultAndValidateRunOptions
(
options
*
options
.
ServerRunOptions
)
{
...
...
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