Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Deprecate old pausing predicates #11300

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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