|
63 | 63 | logOptions = logs.NewOptions()
|
64 | 64 | webhookPort int
|
65 | 65 | webhookCertDir string
|
| 66 | + watchFilterValue string |
66 | 67 |
|
67 | 68 | scheme = runtime.NewScheme()
|
68 | 69 | setupLog = ctrl.Log.WithName("setup")
|
@@ -131,6 +132,9 @@ func initFlags(fs *pflag.FlagSet) {
|
131 | 132 | fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/",
|
132 | 133 | "The webhook certificate directory, where the server should find the TLS certificate and key.")
|
133 | 134 |
|
| 135 | + fs.StringVar(&watchFilterValue, "watch-filter", "", |
| 136 | + fmt.Sprintf("Label value that the controller watches to reconcile cluster-api objects. Label key is always %s. If unspecified, the controller watches for all cluster-api objects.", capiv1beta1.WatchLabel)) |
| 137 | + |
134 | 138 | logsv1.AddFlags(logOptions, fs)
|
135 | 139 | flags.AddManagerOptions(fs, &managerOptions)
|
136 | 140 | }
|
@@ -278,10 +282,11 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, serviceEndpoint []e
|
278 | 282 | }
|
279 | 283 |
|
280 | 284 | if err := (&controllers.IBMPowerVSMachineReconciler{
|
281 |
| - Client: mgr.GetClient(), |
282 |
| - Recorder: mgr.GetEventRecorderFor("ibmpowervsmachine-controller"), |
283 |
| - ServiceEndpoint: serviceEndpoint, |
284 |
| - Scheme: mgr.GetScheme(), |
| 285 | + Client: mgr.GetClient(), |
| 286 | + Recorder: mgr.GetEventRecorderFor("ibmpowervsmachine-controller"), |
| 287 | + ServiceEndpoint: serviceEndpoint, |
| 288 | + Scheme: mgr.GetScheme(), |
| 289 | + WatchFilterValue: watchFilterValue, |
285 | 290 | }).SetupWithManager(ctx, mgr); err != nil {
|
286 | 291 | setupLog.Error(err, "unable to create controller", "controller", "IBMPowerVSMachine")
|
287 | 292 | os.Exit(1)
|
|
0 commit comments