@@ -64,26 +64,28 @@ func init() {
64
64
65
65
func main () {
66
66
var (
67
- metricsAddr string
68
- eventsAddr string
69
- healthAddr string
70
- concurrent int
71
- requeueDependency time.Duration
72
- watchAllNamespaces bool
73
- httpRetry int
74
- clientOptions client.Options
75
- kubeConfigOpts client.KubeConfigOptions
76
- logOptions logger.Options
77
- aclOptions acl.Options
78
- leaderElectionOptions leaderelection.Options
79
- rateLimiterOptions helper.RateLimiterOptions
67
+ metricsAddr string
68
+ eventsAddr string
69
+ healthAddr string
70
+ concurrent int
71
+ requeueDependency time.Duration
72
+ gracefulShutdownTimeout time.Duration
73
+ watchAllNamespaces bool
74
+ httpRetry int
75
+ clientOptions client.Options
76
+ kubeConfigOpts client.KubeConfigOptions
77
+ logOptions logger.Options
78
+ aclOptions acl.Options
79
+ leaderElectionOptions leaderelection.Options
80
+ rateLimiterOptions helper.RateLimiterOptions
80
81
)
81
82
82
83
flag .StringVar (& metricsAddr , "metrics-addr" , ":8080" , "The address the metric endpoint binds to." )
83
84
flag .StringVar (& eventsAddr , "events-addr" , "" , "The address of the events receiver." )
84
85
flag .StringVar (& healthAddr , "health-addr" , ":9440" , "The address the health endpoint binds to." )
85
86
flag .IntVar (& concurrent , "concurrent" , 4 , "The number of concurrent HelmRelease reconciles." )
86
87
flag .DurationVar (& requeueDependency , "requeue-dependency" , 30 * time .Second , "The interval at which failing dependencies are reevaluated." )
88
+ flag .DurationVar (& gracefulShutdownTimeout , "graceful-shutdown-timeout" , 0 , "The duration given to the reconciler to finish before forcibly stopping." )
87
89
flag .BoolVar (& watchAllNamespaces , "watch-all-namespaces" , true ,
88
90
"Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace." )
89
91
flag .IntVar (& httpRetry , "http-retry" , 9 , "The maximum number of retries when failing to fetch artifacts over HTTP." )
@@ -120,6 +122,7 @@ func main() {
120
122
LeaseDuration : & leaderElectionOptions .LeaseDuration ,
121
123
RenewDeadline : & leaderElectionOptions .RenewDeadline ,
122
124
RetryPeriod : & leaderElectionOptions .RetryPeriod ,
125
+ GracefulShutdownTimeout : & gracefulShutdownTimeout ,
123
126
LeaderElectionID : fmt .Sprintf ("%s-leader-election" , controllerName ),
124
127
Namespace : watchNamespace ,
125
128
Logger : ctrl .Log ,
0 commit comments