...
1
16
17 package options
18
19 import (
20 "github.com/spf13/pflag"
21
22 replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
23 )
24
25
26 type ReplicaSetControllerOptions struct {
27 *replicasetconfig.ReplicaSetControllerConfiguration
28 }
29
30
31 func (o *ReplicaSetControllerOptions) AddFlags(fs *pflag.FlagSet) {
32 if o == nil {
33 return
34 }
35
36 fs.Int32Var(&o.ConcurrentRSSyncs, "concurrent-replicaset-syncs", o.ConcurrentRSSyncs, "The number of replica sets that are allowed to sync concurrently. Larger number = more responsive replica management, but more CPU (and network) load")
37 }
38
39
40 func (o *ReplicaSetControllerOptions) ApplyTo(cfg *replicasetconfig.ReplicaSetControllerConfiguration) error {
41 if o == nil {
42 return nil
43 }
44
45 cfg.ConcurrentRSSyncs = o.ConcurrentRSSyncs
46
47 return nil
48 }
49
50
51 func (o *ReplicaSetControllerOptions) Validate() []error {
52 if o == nil {
53 return nil
54 }
55
56 errs := []error{}
57 return errs
58 }
59
View as plain text