mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Verify if Secure and InsecurePort are equal for apiserver
This commit is contained in:
parent
31da82df52
commit
606feff2cb
@ -585,25 +585,26 @@ func verifyEtcdServersList(options *options.ServerRunOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
func verifySecurePort(options *options.ServerRunOptions) {
|
||||
func verifySecureAndInsecurePort(options *options.ServerRunOptions) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Allow 0 to turn off insecure port.
|
||||
func verifyInsecurePort(options *options.ServerRunOptions) {
|
||||
// TODO: Allow 0 to turn off insecure port.
|
||||
if options.InsecurePort < 1 || options.InsecurePort > 65535 {
|
||||
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) {
|
||||
verifyClusterIPFlags(options)
|
||||
verifyServiceNodePort(options)
|
||||
verifyEtcdServersList(options)
|
||||
verifySecurePort(options)
|
||||
verifyInsecurePort(options)
|
||||
verifySecureAndInsecurePort(options)
|
||||
}
|
||||
|
||||
func DefaultAndValidateRunOptions(options *options.ServerRunOptions) {
|
||||
|
Loading…
Reference in New Issue
Block a user