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