Skip to content

Commit 02410f2

Browse files
committed
Log controller name in predicates
1 parent 9c08773 commit 02410f2

File tree

21 files changed

+86
-65
lines changed

21 files changed

+86
-65
lines changed

bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ func (r *KubeadmConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl
110110
r.TokenTTL = DefaultTokenTTL
111111
}
112112

113+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "kubeadmconfig")
113114
b := ctrl.NewControllerManagedBy(mgr).
114115
For(&bootstrapv1.KubeadmConfig{}).
115116
WithOptions(options).
116117
Watches(
117118
&clusterv1.Machine{},
118119
handler.EnqueueRequestsFromMapFunc(r.MachineToBootstrapMapFunc),
119-
).WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue))
120+
).WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue))
120121

121122
if feature.Gates.Enabled(feature.MachinePool) {
122123
b = b.Watches(
@@ -129,9 +130,9 @@ func (r *KubeadmConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl
129130
&clusterv1.Cluster{},
130131
handler.EnqueueRequestsFromMapFunc(r.ClusterToKubeadmConfigs),
131132
builder.WithPredicates(
132-
predicates.All(ctrl.LoggerFrom(ctx),
133-
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
134-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
133+
predicates.All(predicateLog,
134+
predicates.ClusterUnpausedAndInfrastructureReady(predicateLog),
135+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
135136
),
136137
),
137138
)

controllers/remote/cluster_cache_reconciler.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ type ClusterCacheReconciler struct {
4141
}
4242

4343
func (r *ClusterCacheReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
44+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "remote/clustercache")
4445
err := ctrl.NewControllerManagedBy(mgr).
4546
Named("remote/clustercache").
4647
For(&clusterv1.Cluster{}).
4748
WithOptions(options).
48-
WithEventFilter(predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
49+
WithEventFilter(predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue)).
4950
Complete(r)
5051

5152
if err != nil {

controlplane/kubeadm/internal/controllers/controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,19 @@ type KubeadmControlPlaneReconciler struct {
9393
}
9494

9595
func (r *KubeadmControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
96+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "kubeadmcontrolplane")
9697
c, err := ctrl.NewControllerManagedBy(mgr).
9798
For(&controlplanev1.KubeadmControlPlane{}).
9899
Owns(&clusterv1.Machine{}).
99100
WithOptions(options).
100-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
101+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
101102
Watches(
102103
&clusterv1.Cluster{},
103104
handler.EnqueueRequestsFromMapFunc(r.ClusterToKubeadmControlPlane),
104105
builder.WithPredicates(
105-
predicates.All(ctrl.LoggerFrom(ctx),
106-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
107-
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
106+
predicates.All(predicateLog,
107+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
108+
predicates.ClusterUnpausedAndInfrastructureReady(predicateLog),
108109
),
109110
),
110111
).Build(r)

exp/addons/internal/controllers/clusterresourceset_controller.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type ClusterResourceSetReconciler struct {
6868
}
6969

7070
func (r *ClusterResourceSetReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options, partialSecretCache cache.Cache) error {
71+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "clusterresourceset")
7172
err := ctrl.NewControllerManagedBy(mgr).
7273
For(&addonsv1.ClusterResourceSet{}).
7374
Watches(
@@ -80,7 +81,7 @@ func (r *ClusterResourceSetReconciler) SetupWithManager(ctx context.Context, mgr
8081
resourceToClusterResourceSetFunc[client.Object](r.Client),
8182
),
8283
builder.WithPredicates(
83-
resourcepredicates.TypedResourceCreateOrUpdate[client.Object](ctrl.LoggerFrom(ctx)),
84+
resourcepredicates.TypedResourceCreateOrUpdate[client.Object](predicateLog),
8485
),
8586
).
8687
WatchesRawSource(source.Kind(
@@ -94,10 +95,10 @@ func (r *ClusterResourceSetReconciler) SetupWithManager(ctx context.Context, mgr
9495
handler.TypedEnqueueRequestsFromMapFunc(
9596
resourceToClusterResourceSetFunc[*metav1.PartialObjectMetadata](r.Client),
9697
),
97-
resourcepredicates.TypedResourceCreateOrUpdate[*metav1.PartialObjectMetadata](ctrl.LoggerFrom(ctx)),
98+
resourcepredicates.TypedResourceCreateOrUpdate[*metav1.PartialObjectMetadata](predicateLog),
9899
)).
99100
WithOptions(options).
100-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
101+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
101102
Complete(r)
102103
if err != nil {
103104
return errors.Wrap(err, "failed setting up with a controller manager")

exp/addons/internal/controllers/clusterresourcesetbinding_controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ type ClusterResourceSetBindingReconciler struct {
4848
}
4949

5050
func (r *ClusterResourceSetBindingReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
51+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "clusterresourcesetbinding")
5152
err := ctrl.NewControllerManagedBy(mgr).
5253
For(&addonsv1.ClusterResourceSetBinding{}).
5354
Watches(
5455
&clusterv1.Cluster{},
5556
handler.EnqueueRequestsFromMapFunc(r.clusterToClusterResourceSetBinding),
5657
).
5758
WithOptions(options).
58-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
59+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
5960
Complete(r)
6061
if err != nil {
6162
return errors.Wrap(err, "failed setting up with a controller manager")

exp/internal/controllers/machinepool_controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ type scope struct {
9696
}
9797

9898
func (r *MachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
99+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "machinepool")
99100
clusterToMachinePools, err := util.ClusterToTypedObjectsMapper(mgr.GetClient(), &expv1.MachinePoolList{}, mgr.GetScheme())
100101
if err != nil {
101102
return err
@@ -104,15 +105,15 @@ func (r *MachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.M
104105
c, err := ctrl.NewControllerManagedBy(mgr).
105106
For(&expv1.MachinePool{}).
106107
WithOptions(options).
107-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
108+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
108109
Watches(
109110
&clusterv1.Cluster{},
110111
handler.EnqueueRequestsFromMapFunc(clusterToMachinePools),
111112
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
112113
builder.WithPredicates(
113-
predicates.All(ctrl.LoggerFrom(ctx),
114-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
115-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
114+
predicates.All(predicateLog,
115+
predicates.ClusterUnpaused(predicateLog),
116+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
116117
),
117118
),
118119
).

exp/runtime/internal/controllers/extensionconfig_controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ type Reconciler struct {
6363
}
6464

6565
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options, partialSecretCache cache.Cache) error {
66+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "extensionconfig")
6667
err := ctrl.NewControllerManagedBy(mgr).
6768
For(&runtimev1.ExtensionConfig{}).
6869
WatchesRawSource(source.Kind(
@@ -78,7 +79,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
7879
),
7980
)).
8081
WithOptions(options).
81-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
82+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
8283
Complete(r)
8384
if err != nil {
8485
return errors.Wrap(err, "failed setting up with a controller manager")

internal/controllers/cluster/cluster_controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,15 @@ type Reconciler struct {
7777
}
7878

7979
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
80+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "cluster")
8081
c, err := ctrl.NewControllerManagedBy(mgr).
8182
For(&clusterv1.Cluster{}).
8283
Watches(
8384
&clusterv1.Machine{},
8485
handler.EnqueueRequestsFromMapFunc(r.controlPlaneMachineToCluster),
8586
).
8687
WithOptions(options).
87-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
88+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
8889
Build(r)
8990

9091
if err != nil {

internal/controllers/clusterclass/clusterclass_controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ type Reconciler struct {
7070
}
7171

7272
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
73+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "clusterclass")
7374
err := ctrl.NewControllerManagedBy(mgr).
7475
For(&clusterv1.ClusterClass{}).
7576
Named("clusterclass").
@@ -78,7 +79,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
7879
&runtimev1.ExtensionConfig{},
7980
handler.EnqueueRequestsFromMapFunc(r.extensionConfigToClusterClass),
8081
).
81-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
82+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
8283
Complete(r)
8384

8485
if err != nil {

internal/controllers/machine/machine_controller.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ type Reconciler struct {
9494
}
9595

9696
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
97+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "machine")
9798
clusterToMachines, err := util.ClusterToTypedObjectsMapper(mgr.GetClient(), &clusterv1.MachineList{}, mgr.GetScheme())
9899
if err != nil {
99100
return err
@@ -114,18 +115,18 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
114115
c, err := ctrl.NewControllerManagedBy(mgr).
115116
For(&clusterv1.Machine{}).
116117
WithOptions(options).
117-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
118+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
118119
Watches(
119120
&clusterv1.Cluster{},
120121
handler.EnqueueRequestsFromMapFunc(clusterToMachines),
121122
builder.WithPredicates(
122123
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
123-
predicates.All(ctrl.LoggerFrom(ctx),
124-
predicates.Any(ctrl.LoggerFrom(ctx),
125-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
126-
predicates.ClusterControlPlaneInitialized(ctrl.LoggerFrom(ctx)),
124+
predicates.All(predicateLog,
125+
predicates.Any(predicateLog,
126+
predicates.ClusterUnpaused(predicateLog),
127+
predicates.ClusterControlPlaneInitialized(predicateLog),
127128
),
128-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
129+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
129130
),
130131
)).
131132
Watches(

internal/controllers/machinedeployment/machinedeployment_controller.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type Reconciler struct {
7373
}
7474

7575
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
76+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "machinedeployment")
7677
clusterToMachineDeployments, err := util.ClusterToTypedObjectsMapper(mgr.GetClient(), &clusterv1.MachineDeploymentList{}, mgr.GetScheme())
7778
if err != nil {
7879
return err
@@ -87,14 +88,14 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
8788
handler.EnqueueRequestsFromMapFunc(r.MachineSetToDeployments),
8889
).
8990
WithOptions(options).
90-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
91+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
9192
Watches(
9293
&clusterv1.Cluster{},
9394
handler.EnqueueRequestsFromMapFunc(clusterToMachineDeployments),
9495
builder.WithPredicates(
9596
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
96-
predicates.All(ctrl.LoggerFrom(ctx),
97-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
97+
predicates.All(predicateLog,
98+
predicates.ClusterUnpaused(predicateLog),
9899
),
99100
),
100101
).Complete(r)

internal/controllers/machinehealthcheck/machinehealthcheck_controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,23 @@ type Reconciler struct {
8585
}
8686

8787
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
88+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "machinehealthcheck")
8889
c, err := ctrl.NewControllerManagedBy(mgr).
8990
For(&clusterv1.MachineHealthCheck{}).
9091
Watches(
9192
&clusterv1.Machine{},
9293
handler.EnqueueRequestsFromMapFunc(r.machineToMachineHealthCheck),
9394
).
9495
WithOptions(options).
95-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
96+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
9697
Watches(
9798
&clusterv1.Cluster{},
9899
handler.EnqueueRequestsFromMapFunc(r.clusterToMachineHealthCheck),
99100
builder.WithPredicates(
100101
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
101-
predicates.All(ctrl.LoggerFrom(ctx),
102-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
103-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
102+
predicates.All(predicateLog,
103+
predicates.ClusterUnpaused(predicateLog),
104+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
104105
),
105106
),
106107
).Build(r)

internal/controllers/machineset/machineset_controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ type Reconciler struct {
9797
}
9898

9999
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
100+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "machineset")
100101
clusterToMachineSets, err := util.ClusterToTypedObjectsMapper(mgr.GetClient(), &clusterv1.MachineSetList{}, mgr.GetScheme())
101102
if err != nil {
102103
return err
@@ -111,15 +112,15 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
111112
handler.EnqueueRequestsFromMapFunc(r.MachineToMachineSets),
112113
).
113114
WithOptions(options).
114-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
115+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
115116
Watches(
116117
&clusterv1.Cluster{},
117118
handler.EnqueueRequestsFromMapFunc(clusterToMachineSets),
118119
builder.WithPredicates(
119120
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
120-
predicates.All(ctrl.LoggerFrom(ctx),
121-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
122-
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue),
121+
predicates.All(predicateLog,
122+
predicates.ClusterUnpaused(predicateLog),
123+
predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue),
123124
),
124125
),
125126
).Complete(r)

internal/controllers/topology/cluster/cluster_controller.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ type Reconciler struct {
8888
}
8989

9090
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
91+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "topology/cluster")
9192
c, err := ctrl.NewControllerManagedBy(mgr).
9293
For(&clusterv1.Cluster{}, builder.WithPredicates(
9394
// Only reconcile Cluster with topology.
94-
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
95+
predicates.ClusterHasTopology(predicateLog),
9596
)).
9697
Named("topology/cluster").
9798
Watches(
@@ -102,16 +103,16 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
102103
&clusterv1.MachineDeployment{},
103104
handler.EnqueueRequestsFromMapFunc(r.machineDeploymentToCluster),
104105
// Only trigger Cluster reconciliation if the MachineDeployment is topology owned.
105-
builder.WithPredicates(predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx))),
106+
builder.WithPredicates(predicates.ResourceIsTopologyOwned(predicateLog)),
106107
).
107108
Watches(
108109
&expv1.MachinePool{},
109110
handler.EnqueueRequestsFromMapFunc(r.machinePoolToCluster),
110111
// Only trigger Cluster reconciliation if the MachinePool is topology owned.
111-
builder.WithPredicates(predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx))),
112+
builder.WithPredicates(predicates.ResourceIsTopologyOwned(predicateLog)),
112113
).
113114
WithOptions(options).
114-
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
115+
WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(predicateLog, r.WatchFilterValue)).
115116
Build(r)
116117

117118
if err != nil {

internal/controllers/topology/machinedeployment/machinedeployment_controller.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type Reconciler struct {
5959
}
6060

6161
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
62+
predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "topology/machinedeployment")
6263
clusterToMachineDeployments, err := util.ClusterToTypedObjectsMapper(mgr.GetClient(), &clusterv1.MachineDeploymentList{}, mgr.GetScheme())
6364
if err != nil {
6465
return err
@@ -67,21 +68,21 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
6768
err = ctrl.NewControllerManagedBy(mgr).
6869
For(&clusterv1.MachineDeployment{},
6970
builder.WithPredicates(
70-
predicates.All(ctrl.LoggerFrom(ctx),
71-
predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx)),
72-
predicates.ResourceNotPaused(ctrl.LoggerFrom(ctx))),
71+
predicates.All(predicateLog,
72+
predicates.ResourceIsTopologyOwned(predicateLog),
73+
predicates.ResourceNotPaused(predicateLog)),
7374
),
7475
).
7576
Named("topology/machinedeployment").
7677
WithOptions(options).
77-
WithEventFilter(predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
78+
WithEventFilter(predicates.ResourceHasFilterLabel(predicateLog, r.WatchFilterValue)).
7879
Watches(
7980
&clusterv1.Cluster{},
8081
handler.EnqueueRequestsFromMapFunc(clusterToMachineDeployments),
8182
builder.WithPredicates(
82-
predicates.All(ctrl.LoggerFrom(ctx),
83-
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
84-
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
83+
predicates.All(predicateLog,
84+
predicates.ClusterUnpaused(predicateLog),
85+
predicates.ClusterHasTopology(predicateLog),
8586
),
8687
),
8788
).

0 commit comments

Comments
 (0)