Skip to content

Commit

Permalink
deprecate old pausing predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Oct 21, 2024
1 parent f973add commit f2a48e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func (r *DockerMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr
&clusterv1.Cluster{},
handler.EnqueueRequestsFromMapFunc(clusterToDockerMachinePools),
builder.WithPredicates(
//nolint:staticcheck // This usage will be removed when adding v1beta2 status and implementing the Paused condition.
predicates.ClusterUnpausedAndInfrastructureReady(mgr.GetScheme(), predicateLog),
),
).Build(r)
Expand Down
6 changes: 6 additions & 0 deletions util/predicates/cluster_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import (

// ClusterCreateInfraReady returns a predicate that returns true for a create event when a cluster has Status.InfrastructureReady set as true
// it also returns true if the resource provided is not a Cluster to allow for use with controller-runtime NewControllerManagedBy.
//
// Deprecated: This predicate is deprecated and will be removed in a future version. On creation of a cluster the status will always be empty.
// Because of that the predicate would never return true for InfrastructureReady.
func ClusterCreateInfraReady(scheme *runtime.Scheme, logger logr.Logger) predicate.Funcs {
return predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool {
Expand Down Expand Up @@ -285,6 +288,9 @@ func ClusterPausedTransitionsOrInfrastructureReady(scheme *runtime.Scheme, logge
// handler.EnqueueRequestsFromMapFunc(clusterToMachines)
// predicates.ClusterUnpausedAndInfrastructureReady(mgr.GetScheme(), r.Log),
// )
//
// Deprecated: This predicate is deprecated and will be removed in a future version,
// use ClusterPausedTransitionsOrInfrastructureReady instead.
func ClusterUnpausedAndInfrastructureReady(scheme *runtime.Scheme, logger logr.Logger) predicate.Funcs {
log := logger.WithValues("predicate", "ClusterUnpausedAndInfrastructureReady")

Expand Down

0 comments on commit f2a48e5

Please sign in to comment.