1 /* 2 Copyright 2019 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 v1alpha1 18 19 import ( 20 kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1" 21 ) 22 23 // RecommendedDefaultStatefulSetControllerConfiguration defaults a pointer to a 24 // StatefulSetControllerConfiguration struct. This will set the recommended default 25 // values, but they may be subject to change between API versions. This function 26 // is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo` 27 // function to allow consumers of this type to set whatever defaults for their 28 // embedded configs. Forcing consumers to use these defaults would be problematic 29 // as defaulting in the scheme is done as part of the conversion, and there would 30 // be no easy way to opt-out. Instead, if you want to use this defaulting method 31 // run it in your wrapper struct of this type in its `SetDefaults_` method. 32 func RecommendedDefaultStatefulSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.StatefulSetControllerConfiguration) { 33 if obj.ConcurrentStatefulSetSyncs == 0 { 34 obj.ConcurrentStatefulSetSyncs = 5 35 } 36 } 37