|
80 | 80 | machinePoolConcurrency int
|
81 | 81 | clusterResourceSetConcurrency int
|
82 | 82 | machineHealthCheckConcurrency int
|
| 83 | + waitForNodeDeletion bool |
83 | 84 | syncPeriod time.Duration
|
84 | 85 | webhookPort int
|
85 | 86 | webhookCertDir string
|
@@ -160,6 +161,9 @@ func InitFlags(fs *pflag.FlagSet) {
|
160 | 161 | fs.IntVar(&machineHealthCheckConcurrency, "machinehealthcheck-concurrency", 10,
|
161 | 162 | "Number of machine health checks to process simultaneously")
|
162 | 163 |
|
| 164 | + fs.BoolVar(&waitForNodeDeletion, "wait-for-node-deletion", false, |
| 165 | + "If set, the Machine controller will postpone deletion of a Machine until the corresponding node is deleted in the Cluster's API.") |
| 166 | + |
163 | 167 | fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute,
|
164 | 168 | "The minimum interval at which watched resources are reconciled (e.g. 15m)")
|
165 | 169 |
|
@@ -341,10 +345,11 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
|
341 | 345 | os.Exit(1)
|
342 | 346 | }
|
343 | 347 | if err := (&controllers.MachineReconciler{
|
344 |
| - Client: mgr.GetClient(), |
345 |
| - APIReader: mgr.GetAPIReader(), |
346 |
| - Tracker: tracker, |
347 |
| - WatchFilterValue: watchFilterValue, |
| 348 | + Client: mgr.GetClient(), |
| 349 | + APIReader: mgr.GetAPIReader(), |
| 350 | + Tracker: tracker, |
| 351 | + WatchFilterValue: watchFilterValue, |
| 352 | + WaitForNodeDeletion: waitForNodeDeletion, |
348 | 353 | }).SetupWithManager(ctx, mgr, concurrency(machineConcurrency)); err != nil {
|
349 | 354 | setupLog.Error(err, "unable to create controller", "controller", "Machine")
|
350 | 355 | os.Exit(1)
|
|
0 commit comments