Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil-Grigorev committed Apr 17, 2024
1 parent 4942537 commit 82aaf71
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ func (r *KubeadmConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Machine{},
handler.EnqueueRequestsFromObjectMap(r.MachineToBootstrapMapFunc),
handler.EnqueueRequestsFromTypedMapFunc(r.MachineToBootstrapMapFunc),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Machine{}),
))

if feature.Gates.Enabled(feature.MachinePool) {
b = b.Add(builder.Watches(mgr,
&expv1.MachinePool{},
handler.EnqueueRequestsFromObjectMap(r.MachinePoolToBootstrapMapFunc),
handler.EnqueueRequestsFromTypedMapFunc(r.MachinePoolToBootstrapMapFunc),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &expv1.MachinePool{}),
))
}

b = b.Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(r.ClusterToKubeadmConfigs),
handler.EnqueueRequestsFromTypedMapFunc(r.ClusterToKubeadmConfigs),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
))
Expand Down
4 changes: 3 additions & 1 deletion controllers/external/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ func (o *ObjectTracker) Watch(log logr.Logger, obj client.Object, handler handle
return nil
}

var c client.Object
u := &unstructured.Unstructured{}
u.SetGroupVersionKind(gvk)
c = u

log.Info(fmt.Sprintf("Adding watch on external object %q", gvk.String()))
err := o.Controller.Watch(
source.Kind(o.Cache, u).Prepare(handler, append(p, predicates.ResourceNotPaused(log, obj))...),
source.Kind(o.Cache, c, handler, append(p, predicates.ResourceNotPaused(log, obj))...),
)
if err != nil {
o.m.Delete(key)
Expand Down
2 changes: 1 addition & 1 deletion controllers/remote/cluster_cache_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func (t *ClusterCacheTracker) Watch(ctx context.Context, input WatchInput) error
}

// Need to create the watch
if err := input.Watcher.Watch(source.Kind(accessor.cache, input.Kind), input.EventHandler, input.Predicates...); err != nil {
if err := input.Watcher.Watch(source.Kind(accessor.cache, input.Kind, nil), input.EventHandler, input.Predicates...); err != nil {
return errors.Wrapf(err, "failed to add %s watch on cluster %s: failed to create watch", input.Kind, klog.KRef(input.Cluster.Namespace, input.Cluster.Name))
}

Expand Down
2 changes: 1 addition & 1 deletion controlplane/kubeadm/internal/controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (r *KubeadmControlPlaneReconciler) SetupWithManager(ctx context.Context, mg
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(r.ClusterToKubeadmControlPlane),
handler.EnqueueRequestsFromTypedMapFunc(r.ClusterToKubeadmControlPlane),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
)).Build(r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (r *ClusterResourceSetReconciler) SetupWithManager(ctx context.Context, mgr
)).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(r.clusterToClusterResourceSet),
handler.EnqueueRequestsFromTypedMapFunc(r.clusterToClusterResourceSet),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
)).
WatchesMetadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (r *ClusterResourceSetBindingReconciler) SetupWithManager(ctx context.Conte
For(&addonsv1.ClusterResourceSetBinding{}).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(r.clusterToClusterResourceSetBinding),
handler.EnqueueRequestsFromTypedMapFunc(r.clusterToClusterResourceSetBinding),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
)).
WithOptions(options).
Expand Down
4 changes: 2 additions & 2 deletions exp/internal/controllers/machinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (r *MachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.M
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachinePools),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachinePools),
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
Expand Down Expand Up @@ -333,7 +333,7 @@ func (r *MachinePoolReconciler) watchClusterNodes(ctx context.Context, cluster *
Cluster: util.ObjectKey(cluster),
Watcher: &controller.ControllerAdapter{Controller: r.controller},
Kind: &corev1.Node{},
EventHandler: handler.EnqueueRequestsFromObjectMapFunc(r.nodeToMachinePool),
EventHandler: handler.EnqueueRequestsFromMapFunc(r.nodeToMachinePool),
})
}

Expand Down
2 changes: 1 addition & 1 deletion exp/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func GetMachinePoolByLabels(ctx context.Context, c client.Client, namespace stri

// MachinePoolToInfrastructureMapFunc returns a handler.MapFunc that watches for
// MachinePool events and returns reconciliation requests for an infrastructure provider object.
func MachinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind, log logr.Logger) handler.ObjectMapFunc[*expv1.MachinePool] {
func MachinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind, log logr.Logger) handler.TypedMapFunc[*expv1.MachinePool] {
log = log.WithValues("machine-pool-to-infra-map-func", gvk.String())
return func(_ context.Context, m *expv1.MachinePool) []reconcile.Request {
log := log.WithValues("MachinePool", klog.KObj(m))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api

go 1.22.0

replace sigs.k8s.io/controller-runtime => github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571
replace sigs.k8s.io/controller-runtime => github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e

require (
github.com/MakeNowJust/heredoc v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571 h1:a1Oaf+Zk1mbhUP0wVULBOLZ+b4MXLW6g/2kadPQg5yw=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571/go.mod h1:TLM3OvUJgcqHVBLVRlNylmfbOlOukMLFHtc6jo3EtIQ=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e h1:hEGMiTp7lLNM666lIVpXzlyjkTpAMV+iYcnofBNKAYk=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e/go.mod h1:TLM3OvUJgcqHVBLVRlNylmfbOlOukMLFHtc6jo3EtIQ=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down
2 changes: 1 addition & 1 deletion internal/controllers/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
Add(builder.For(mgr, &clusterv1.Cluster{}, predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}))).
Add(builder.Watches(mgr,
&clusterv1.Machine{},
handler.EnqueueRequestsFromObjectMap(r.controlPlaneMachineToCluster),
handler.EnqueueRequestsFromTypedMapFunc(r.controlPlaneMachineToCluster),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Machine{}),
)).
WithOptions(options).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
Named("clusterclass").
WithOptions(options).
Add(builder.Watches(mgr, &runtimev1.ExtensionConfig{},
handler.EnqueueRequestsFromObjectMap(r.extensionConfigToClusterClass),
handler.EnqueueRequestsFromTypedMapFunc(r.extensionConfigToClusterClass),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &runtimev1.ExtensionConfig{}))).
Complete(r)

Expand Down
12 changes: 6 additions & 6 deletions internal/controllers/machine/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachines),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachines),
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicate.Any(
predicate.Any(
predicate.Or(
predicate.Or(
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ClusterControlPlaneInitialized(ctrl.LoggerFrom(ctx)),
),
Expand All @@ -132,12 +132,12 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
)).
Add(builder.Watches(mgr,
&clusterv1.MachineSet{},
handler.EnqueueRequestsFromObjectMap(msToMachines),
handler.EnqueueRequestsFromTypedMapFunc(msToMachines),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.MachineSet{}),
)).
Add(builder.Watches(mgr,
&clusterv1.MachineDeployment{},
handler.EnqueueRequestsFromObjectMap(mdToMachines),
handler.EnqueueRequestsFromTypedMapFunc(mdToMachines),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.MachineDeployment{}),
)).
Build(r)
Expand Down Expand Up @@ -861,7 +861,7 @@ func (r *Reconciler) watchClusterNodes(ctx context.Context, cluster *clusterv1.C
Cluster: util.ObjectKey(cluster),
Watcher: &controller.ControllerAdapter{Controller: r.controller},
Kind: &corev1.Node{},
EventHandler: handler.EnqueueRequestsFromObjectMapFunc(r.nodeToMachine),
EventHandler: handler.EnqueueRequestsFromTypedMapFuncFunc(r.nodeToMachine),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
// Watches enqueues MachineDeployment for corresponding MachineSet resources, if no managed controller reference (owner) exists.
Add(builder.Watches(mgr,
&clusterv1.MachineSet{},
handler.EnqueueRequestsFromObjectMap(r.MachineSetToDeployments),
handler.EnqueueRequestsFromTypedMapFunc(r.MachineSetToDeployments),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.MachineSet{})),
).
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachineDeployments),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachineDeployments),
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
)).Complete(r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.MachineHealthCheck{}))).
Add(builder.Watches(mgr,
&clusterv1.Machine{},
handler.EnqueueRequestsFromObjectMap(r.machineToMachineHealthCheck),
handler.EnqueueRequestsFromTypedMapFunc(r.machineToMachineHealthCheck),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Machine{}),
)).
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(r.clusterToMachineHealthCheck),
handler.EnqueueRequestsFromTypedMapFunc(r.clusterToMachineHealthCheck),
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
Expand Down Expand Up @@ -517,7 +517,7 @@ func (r *Reconciler) watchClusterNodes(ctx context.Context, cluster *clusterv1.C
Cluster: util.ObjectKey(cluster),
Watcher: &controller.ControllerAdapter{Controller: r.controller},
Kind: &corev1.Node{},
EventHandler: handler.EnqueueRequestsFromObjectMapFunc(r.nodeToMachineHealthCheck),
EventHandler: handler.EnqueueRequestsFromTypedMapFunc(r.nodeToMachineHealthCheck),
})
}

Expand Down
4 changes: 2 additions & 2 deletions internal/controllers/machineset/machineset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
// Watches enqueues MachineSet for corresponding Machine resources, if no managed controller reference (owner) exists.
Add(builder.Watches(mgr,
&clusterv1.Machine{},
handler.EnqueueRequestsFromObjectMap(r.MachineToMachineSets),
handler.EnqueueRequestsFromTypedMapFunc(r.MachineToMachineSets),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Machine{}),
)).
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachineSets),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachineSets),
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
)).Complete(r)
Expand Down
11 changes: 6 additions & 5 deletions internal/controllers/topology/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/client-go/tools/record"
Expand Down Expand Up @@ -99,19 +100,19 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
Named("topology/cluster").
Add(builder.Watches(mgr,
&clusterv1.ClusterClass{},
handler.EnqueueRequestsFromObjectMap(r.clusterClassToCluster),
handler.EnqueueRequestsFromTypedMapFunc(r.clusterClassToCluster),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.ClusterClass{}),
)).
Add(builder.Watches(mgr,
&clusterv1.MachineDeployment{},
handler.EnqueueRequestsFromObjectMap(r.machineDeploymentToCluster),
handler.EnqueueRequestsFromTypedMapFunc(r.machineDeploymentToCluster),
// Only trigger Cluster reconciliation if the MachineDeployment is topology owned.
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.MachineDeployment{}),
predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx), &clusterv1.MachineDeployment{}),
)).
Add(builder.Watches(mgr,
&expv1.MachinePool{},
handler.EnqueueRequestsFromObjectMap(r.machinePoolToCluster),
handler.EnqueueRequestsFromTypedMapFunc(r.machinePoolToCluster),
// Only trigger Cluster reconciliation if the MachinePool is topology owned.
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &expv1.MachinePool{}),
predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx), &expv1.MachinePool{}),
Expand Down Expand Up @@ -305,9 +306,9 @@ func (r *Reconciler) setupDynamicWatches(ctx context.Context, s *scope.Scope) er
}
if s.Current.ControlPlane.Object != nil {
if err := r.externalTracker.Watch(ctrl.LoggerFrom(ctx), s.Current.ControlPlane.Object,
handler.EnqueueRequestForOwner(r.Client.Scheme(), r.Client.RESTMapper(), &clusterv1.Cluster{}),
handler.TypedEnqueueRequestForOwner[*unstructured.Unstructured](r.Client.Scheme(), r.Client.RESTMapper(), &clusterv1.Cluster{}),
// Only trigger Cluster reconciliation if the ControlPlane is topology owned.
predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx), &clusterv1.Cluster{})); err != nil {
predicates.ResourceIsTopologyOwned(ctrl.LoggerFrom(ctx), &unstructured.Unstructured{})); err != nil {
return errors.Wrap(err, "error watching ControlPlane CR")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachineDeployments),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachineDeployments),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
WithOptions(options).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToMachineSets),
handler.EnqueueRequestsFromTypedMapFunc(clusterToMachineSets),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
predicates.ClusterUnpaused(ctrl.LoggerFrom(ctx)),
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.0

replace sigs.k8s.io/cluster-api => ../

replace sigs.k8s.io/controller-runtime => github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571
replace sigs.k8s.io/controller-runtime => github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
4 changes: 2 additions & 2 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571 h1:a1Oaf+Zk1mbhUP0wVULBOLZ+b4MXLW6g/2kadPQg5yw=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417125124-8984b3049571/go.mod h1:TLM3OvUJgcqHVBLVRlNylmfbOlOukMLFHtc6jo3EtIQ=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e h1:hEGMiTp7lLNM666lIVpXzlyjkTpAMV+iYcnofBNKAYk=
github.com/Danil-Grigorev/controller-runtime v0.6.1-0.20240417201603-e18909c2932e/go.mod h1:TLM3OvUJgcqHVBLVRlNylmfbOlOukMLFHtc6jo3EtIQ=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,18 @@ func (r *DockerMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr
WithOptions(options).
Add(builder.Watches(mgr,
&expv1.MachinePool{},
handler.EnqueueRequestsFromObjectMap(utilexp.MachinePoolToInfrastructureMapFunc(
handler.EnqueueRequestsFromTypedMapFunc(utilexp.MachinePoolToInfrastructureMapFunc(
infraexpv1.GroupVersion.WithKind("DockerMachinePool"), ctrl.LoggerFrom(ctx))),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &expv1.MachinePool{}),
)).
Add(builder.Watches(mgr,
&infrav1.DockerMachine{},
handler.EnqueueRequestsFromObjectMap(dockerMachineToDockerMachinePool),
handler.EnqueueRequestsFromTypedMapFunc(dockerMachineToDockerMachinePool),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &infrav1.DockerMachine{}),
)).
Add(builder.Watches(mgr,
&clusterv1.Cluster{},
handler.EnqueueRequestsFromObjectMap(clusterToDockerMachinePools),
handler.EnqueueRequestsFromTypedMapFunc(clusterToDockerMachinePools),
predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue, &clusterv1.Cluster{}),
predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)),
)).Build(r)
Expand Down
Loading

0 comments on commit 82aaf71

Please sign in to comment.