...
1
16
17 package options
18
19 import (
20 "fmt"
21
22 "github.com/spf13/pflag"
23
24 "k8s.io/kubernetes/cmd/kube-controller-manager/names"
25 ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
26 )
27
28
29 type TTLAfterFinishedControllerOptions struct {
30 *ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration
31 }
32
33
34 func (o *TTLAfterFinishedControllerOptions) AddFlags(fs *pflag.FlagSet) {
35 if o == nil {
36 return
37 }
38
39 fs.Int32Var(&o.ConcurrentTTLSyncs, "concurrent-ttl-after-finished-syncs", o.ConcurrentTTLSyncs, fmt.Sprintf("The number of %s workers that are allowed to sync concurrently.", names.TTLAfterFinishedController))
40 }
41
42
43 func (o *TTLAfterFinishedControllerOptions) ApplyTo(cfg *ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration) error {
44 if o == nil {
45 return nil
46 }
47
48 cfg.ConcurrentTTLSyncs = o.ConcurrentTTLSyncs
49
50 return nil
51 }
52
53
54 func (o *TTLAfterFinishedControllerOptions) Validate() []error {
55 if o == nil {
56 return nil
57 }
58
59 errs := []error{}
60 return errs
61 }
62
View as plain text