remove some options from mega-struct

This commit is contained in:
deads2k
2016-11-09 13:53:23 -05:00
parent 18074d7606
commit 56b7a8b02b
18 changed files with 215 additions and 165 deletions

View File

@@ -49,23 +49,6 @@ func verifyServiceNodePort(options *options.ServerRunOptions) []error {
return errors
}
func verifySecureAndInsecurePort(options *options.ServerRunOptions) []error {
errors := []error{}
errors = append(errors, options.SecureServing.Validate()...)
errors = append(errors, options.InsecureServing.Validate("insecure-port")...)
if (options.SecureServing == nil || options.SecureServing.ServingOptions.BindPort == 0) &&
(options.InsecureServing == nil || options.InsecureServing.BindPort == 0) {
glog.Fatalf("--secure-port and --insecure-port cannot be turned off at the same time.")
}
if options.SecureServing != nil && options.InsecureServing != nil &&
options.SecureServing.ServingOptions.BindPort == options.InsecureServing.BindPort {
errors = append(errors, fmt.Errorf("--secure-port and --insecure-port cannot use the same port."))
}
return errors
}
func ValidateRunOptions(options *options.ServerRunOptions) {
errors := []error{}
if errs := verifyClusterIPFlags(options); len(errs) > 0 {
@@ -74,9 +57,6 @@ func ValidateRunOptions(options *options.ServerRunOptions) {
if errs := verifyServiceNodePort(options); len(errs) > 0 {
errors = append(errors, errs...)
}
if errs := verifySecureAndInsecurePort(options); len(errs) > 0 {
errors = append(errors, errs...)
}
if err := utilerrors.NewAggregate(errors); err != nil {
glog.Fatalf("Validate server run options failed: %v", err)
}