This repository was archived by the owner on Aug 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -354,10 +354,24 @@ func (r *BackstageReconciler) SetupWithManager(mgr ctrl.Manager) error {
354
354
return fmt .Errorf ("failed to construct the predicate for matching secrets. This should not happen: %w" , err )
355
355
}
356
356
357
+ secretMeta := & metav1.PartialObjectMetadata {}
358
+ secretMeta .SetGroupVersionKind (schema.GroupVersionKind {
359
+ Group : "" ,
360
+ Version : "v1" ,
361
+ Kind : "Secret" ,
362
+ })
363
+
364
+ configMapMeta := & metav1.PartialObjectMetadata {}
365
+ configMapMeta .SetGroupVersionKind (schema.GroupVersionKind {
366
+ Group : "" ,
367
+ Version : "v1" ,
368
+ Kind : "ConfigMap" ,
369
+ })
370
+
357
371
b := ctrl .NewControllerManagedBy (mgr ).
358
372
For (& bs.Backstage {}).
359
- Watches (
360
- & corev1. Secret {} ,
373
+ WatchesMetadata (
374
+ secretMeta ,
361
375
handler .EnqueueRequestsFromMapFunc (func (ctx context.Context , o client.Object ) []reconcile.Request {
362
376
return r .requestByLabel (ctx , o )
363
377
}),
@@ -367,8 +381,8 @@ func (r *BackstageReconciler) SetupWithManager(mgr ctrl.Manager) error {
367
381
//CreateFunc: func(e event.CreateEvent) bool { return true },
368
382
}),
369
383
).
370
- Watches (
371
- & corev1. ConfigMap {} ,
384
+ WatchesMetadata (
385
+ configMapMeta ,
372
386
handler .EnqueueRequestsFromMapFunc (func (ctx context.Context , o client.Object ) []reconcile.Request {
373
387
return r .requestByLabel (ctx , o )
374
388
}),
You can’t perform that action at this time.
0 commit comments