Skip to content

Commit f2a48e5

Browse files
committed
deprecate old pausing predicates
1 parent f973add commit f2a48e5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ func (r *DockerMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr
180180
&clusterv1.Cluster{},
181181
handler.EnqueueRequestsFromMapFunc(clusterToDockerMachinePools),
182182
builder.WithPredicates(
183+
//nolint:staticcheck // This usage will be removed when adding v1beta2 status and implementing the Paused condition.
183184
predicates.ClusterUnpausedAndInfrastructureReady(mgr.GetScheme(), predicateLog),
184185
),
185186
).Build(r)

util/predicates/cluster_predicates.go

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import (
3434

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

0 commit comments

Comments
 (0)