mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +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 {
|
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user