Handle feature gate errors

This commit is contained in:
Dr. Stefan Schimanski
2019-04-03 16:49:49 +02:00
parent 7cdd26e127
commit 37046e3028
7 changed files with 19 additions and 6 deletions

View File

@@ -35,7 +35,9 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error
// Make a local copy of the global feature gates and combine it with the gates set by this configuration.
// This allows us to validate the config against the set of gates it will actually run against.
localFeatureGate := utilfeature.DefaultFeatureGate.DeepCopy()
localFeatureGate.SetFromMap(kc.FeatureGates)
if err := localFeatureGate.SetFromMap(kc.FeatureGates); err != nil {
return err
}
if kc.NodeLeaseDurationSeconds <= 0 {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: NodeLeaseDurationSeconds must be greater than 0"))