Skip to content

Commit 229e7ae

Browse files
Remove deprecated code in v1.6
Signed-off-by: Furkat Gofurov <[email protected]>
1 parent bda002f commit 229e7ae

File tree

5 files changed

+0
-374
lines changed

5 files changed

+0
-374
lines changed

controllers/noderefutil/providerid.go

Lines changed: 0 additions & 130 deletions
This file was deleted.

controllers/noderefutil/providerid_test.go

Lines changed: 0 additions & 170 deletions
This file was deleted.

controllers/remote/index.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,3 @@ var NodeProviderIDIndex = Index{
3636
Field: index.NodeProviderIDField,
3737
ExtractValue: index.NodeByProviderID,
3838
}
39-
40-
// DefaultIndexes is the default list of indexes on a ClusterCacheTracker.
41-
//
42-
// Deprecated: This variable is deprecated and will be removed in a future release of Cluster API.
43-
// Instead please use `[]Index{NodeProviderIDIndex}`.
44-
var DefaultIndexes = []Index{NodeProviderIDIndex}

util/retry.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,3 @@ func Retry(fn wait.ConditionFunc, initialBackoffSec int) error {
4646
}
4747
return nil
4848
}
49-
50-
// Poll tries a condition func until it returns true, an error, or the timeout
51-
// is reached.
52-
//
53-
// Deprecated: This function has been deprecated and will be removed in a future release.
54-
// Please use utils from "k8s.io/apimachinery/pkg/util/wait" instead.
55-
func Poll(interval, timeout time.Duration, condition wait.ConditionFunc) error {
56-
return wait.Poll(interval, timeout, condition)
57-
}
58-
59-
// PollImmediate tries a condition func until it returns true, an error, or the timeout
60-
// is reached.
61-
//
62-
// Deprecated: This function has been deprecated and will be removed in a future release.
63-
// Please use utils from "k8s.io/apimachinery/pkg/util/wait" instead.
64-
func PollImmediate(interval, timeout time.Duration, condition wait.ConditionFunc) error {
65-
return wait.PollImmediate(interval, timeout, condition)
66-
}

util/util.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -467,56 +467,6 @@ func (k KubeAwareAPIVersions) Less(i, j int) bool {
467467
return k8sversion.CompareKubeAwareVersionStrings(k[i], k[j]) < 0
468468
}
469469

470-
// ClusterToObjectsMapper returns a mapper function that gets a cluster and lists all objects for the object passed in
471-
// and returns a list of requests.
472-
// NB: The objects are required to have `clusterv1.ClusterNameLabel` applied.
473-
//
474-
// Deprecated: This function is deprecated and will be removed in a future release, use ClusterToTypedObjectsMapper instead.
475-
// The problem with this function is that it uses UnstructuredList to retrieve objects, with the default client configuration
476-
// this will lead to uncached List calls, which is a major performance issue.
477-
func ClusterToObjectsMapper(c client.Client, ro client.ObjectList, scheme *runtime.Scheme) (handler.MapFunc, error) {
478-
gvk, err := apiutil.GVKForObject(ro, scheme)
479-
if err != nil {
480-
return nil, err
481-
}
482-
483-
isNamespaced, err := isAPINamespaced(gvk, c.RESTMapper())
484-
if err != nil {
485-
return nil, err
486-
}
487-
488-
return func(ctx context.Context, o client.Object) []ctrl.Request {
489-
cluster, ok := o.(*clusterv1.Cluster)
490-
if !ok {
491-
return nil
492-
}
493-
494-
listOpts := []client.ListOption{
495-
client.MatchingLabels{
496-
clusterv1.ClusterNameLabel: cluster.Name,
497-
},
498-
}
499-
500-
if isNamespaced {
501-
listOpts = append(listOpts, client.InNamespace(cluster.Namespace))
502-
}
503-
504-
list := &unstructured.UnstructuredList{}
505-
list.SetGroupVersionKind(gvk)
506-
if err := c.List(ctx, list, listOpts...); err != nil {
507-
return nil
508-
}
509-
510-
results := []ctrl.Request{}
511-
for _, obj := range list.Items {
512-
results = append(results, ctrl.Request{
513-
NamespacedName: client.ObjectKey{Namespace: obj.GetNamespace(), Name: obj.GetName()},
514-
})
515-
}
516-
return results
517-
}, nil
518-
}
519-
520470
// ClusterToTypedObjectsMapper returns a mapper function that gets a cluster and lists all objects for the object passed in
521471
// and returns a list of requests.
522472
// Note: This function uses the passed in typed ObjectList and thus with the default client configuration all list calls

0 commit comments

Comments
 (0)