Skip to content

Commit

Permalink
Merge pull request #11744 from sbueringer/prdeprecate-index
Browse files Browse the repository at this point in the history
🌱 Deprecate old ClusterClass index
  • Loading branch information
k8s-ci-robot authored Jan 24, 2025
2 parents 29905d5 + 9efb8dd commit c6d70ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/v1beta1/index/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (

const (
// ClusterClassNameField is used by the Cluster controller to index Clusters by ClusterClass name.
//
// Deprecated: This constant will be removed in an upcoming release, please use ClusterClassRefPath instead.
ClusterClassNameField = "spec.topology.class"

// ClusterClassRefPath is used by the Cluster controller to index Clusters by ClusterClass name and namespace.
Expand Down Expand Up @@ -70,6 +72,8 @@ func ClusterClassRef(cc *clusterv1.ClusterClass) string {

// ByClusterClassName adds the cluster class name index to the
// managers cache.
//
// Deprecated: This func will be removed in an upcoming release, please use ByClusterClassRef instead.
func ByClusterClassName(ctx context.Context, mgr ctrl.Manager) error {
if err := mgr.GetCache().IndexField(ctx, &clusterv1.Cluster{},
ClusterClassNameField,
Expand All @@ -81,6 +85,8 @@ func ByClusterClassName(ctx context.Context, mgr ctrl.Manager) error {
}

// ClusterByClusterClassClassName contains the logic to index Clusters by ClusterClass name.
//
// Deprecated: This func will be removed in an upcoming release, please use ClusterByClusterClassRef instead.
func ClusterByClusterClassClassName(o client.Object) []string {
cluster, ok := o.(*clusterv1.Cluster)
if !ok {
Expand Down

0 comments on commit c6d70ab

Please sign in to comment.