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