mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-22 06:59:03 +00:00
add some checks for fedration-apiserver options
This commit is contained in:
@@ -16,6 +16,8 @@ limitations under the License.
|
||||
|
||||
package options
|
||||
|
||||
import "fmt"
|
||||
|
||||
func (options *ServerRunOptions) Validate() []error {
|
||||
var errors []error
|
||||
if errs := options.Etcd.Validate(); len(errs) > 0 {
|
||||
@@ -27,6 +29,27 @@ func (options *ServerRunOptions) Validate() []error {
|
||||
if errs := options.InsecureServing.Validate("insecure-port"); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.Audit.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.Features.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.Admission.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.Authentication.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.Authorization.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if errs := options.CloudProvider.Validate(); len(errs) > 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
if options.EventTTL <= 0 {
|
||||
errors = append(errors, fmt.Errorf("--event-ttl must be greater than 0"))
|
||||
}
|
||||
// TODO: add more checks
|
||||
return errors
|
||||
}
|
||||
|
Reference in New Issue
Block a user