|
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 |
|
@@ -338,9 +342,10 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
|
338 | 342 | os.Exit(1)
|
339 | 343 | }
|
340 | 344 | if err := (&controllers.MachineReconciler{
|
341 |
| - Client: mgr.GetClient(), |
342 |
| - Tracker: tracker, |
343 |
| - WatchFilterValue: watchFilterValue, |
| 345 | + Client: mgr.GetClient(), |
| 346 | + Tracker: tracker, |
| 347 | + WatchFilterValue: watchFilterValue, |
| 348 | + WaitForNodeDeletion: waitForNodeDeletion, |
344 | 349 | }).SetupWithManager(ctx, mgr, concurrency(machineConcurrency)); err != nil {
|
345 | 350 | setupLog.Error(err, "unable to create controller", "controller", "Machine")
|
346 | 351 | os.Exit(1)
|
|
0 commit comments