|
| 1 | +/* |
| 2 | +Copyright 2016 The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package server |
| 18 | + |
| 19 | +import ( |
| 20 | + "k8s.io/apiserver/pkg/server/options" |
| 21 | +) |
| 22 | + |
| 23 | +// ValidateRecommendedOptions validates the options. |
| 24 | +// |
| 25 | +// A temporary work-around for https://github.com/kubernetes/kubernetes/pull/97954 |
| 26 | +func ValidateRecommendedOptions(o *options.RecommendedOptions) []error { |
| 27 | + errors := []error{} |
| 28 | + |
| 29 | + errors = append(errors, o.Etcd.Validate()...) |
| 30 | + errors = append(errors, o.SecureServing.Validate()...) |
| 31 | + |
| 32 | + if o.Authentication != nil { |
| 33 | + errors = append(errors, o.Authentication.Validate()...) |
| 34 | + } |
| 35 | + if o.Authorization != nil { |
| 36 | + errors = append(errors, o.Authorization.Validate()...) |
| 37 | + } |
| 38 | + |
| 39 | + errors = append(errors, o.Audit.Validate()...) |
| 40 | + errors = append(errors, o.Features.Validate()...) |
| 41 | + errors = append(errors, o.CoreAPI.Validate()...) |
| 42 | + errors = append(errors, o.Admission.Validate()...) |
| 43 | + errors = append(errors, o.EgressSelector.Validate()...) |
| 44 | + |
| 45 | + return errors |
| 46 | + |
| 47 | +} |
0 commit comments