1 /* 2 Copyright 2018 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 options 18 19 import ( 20 "github.com/spf13/pflag" 21 22 daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config" 23 ) 24 25 // DaemonSetControllerOptions holds the DaemonSetController options. 26 type DaemonSetControllerOptions struct { 27 *daemonconfig.DaemonSetControllerConfiguration 28 } 29 30 // AddFlags adds flags related to DaemonSetController for controller manager to the specified FlagSet. 31 func (o *DaemonSetControllerOptions) AddFlags(fs *pflag.FlagSet) { 32 if o == nil { 33 return 34 } 35 } 36 37 // ApplyTo fills up DaemonSetController config with options. 38 func (o *DaemonSetControllerOptions) ApplyTo(cfg *daemonconfig.DaemonSetControllerConfiguration) error { 39 if o == nil { 40 return nil 41 } 42 43 cfg.ConcurrentDaemonSetSyncs = o.ConcurrentDaemonSetSyncs 44 45 return nil 46 } 47 48 // Validate checks validation of DaemonSetControllerOptions. 49 func (o *DaemonSetControllerOptions) Validate() []error { 50 if o == nil { 51 return nil 52 } 53 54 errs := []error{} 55 return errs 56 } 57