Skip to content

Commit 4f387f1

Browse files
committed
⚠️ Remove {Add,Remove}FinalizerWithError utils
Signed-off-by: Vince Prignano <[email protected]>
1 parent 1abbd13 commit 4f387f1

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

pkg/controller/controllerutil/controllerutil.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
"k8s.io/apimachinery/pkg/api/equality"
2424
"k8s.io/apimachinery/pkg/api/errors"
25-
"k8s.io/apimachinery/pkg/api/meta"
2625
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2726
"k8s.io/apimachinery/pkg/runtime"
2827
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -248,19 +247,6 @@ func AddFinalizer(o Object, finalizer string) {
248247
o.SetFinalizers(append(f, finalizer))
249248
}
250249

251-
// AddFinalizerWithError tries to convert a runtime object to a metav1 object and add the provided finalizer.
252-
// It returns an error if the provided object cannot provide an accessor.
253-
//
254-
// Deprecated: Use AddFinalizer instead. Check is performing on compile time.
255-
func AddFinalizerWithError(o runtime.Object, finalizer string) error {
256-
m, err := meta.Accessor(o)
257-
if err != nil {
258-
return err
259-
}
260-
AddFinalizer(m.(Object), finalizer)
261-
return nil
262-
}
263-
264250
// RemoveFinalizer accepts an Object and removes the provided finalizer if present.
265251
func RemoveFinalizer(o Object, finalizer string) {
266252
f := o.GetFinalizers()
@@ -273,19 +259,6 @@ func RemoveFinalizer(o Object, finalizer string) {
273259
o.SetFinalizers(f)
274260
}
275261

276-
// RemoveFinalizerWithError tries to convert a runtime object to a metav1 object and remove the provided finalizer.
277-
// It returns an error if the provided object cannot provide an accessor.
278-
//
279-
// Deprecated: Use RemoveFinalizer instead. Check is performing on compile time.
280-
func RemoveFinalizerWithError(o runtime.Object, finalizer string) error {
281-
m, err := meta.Accessor(o)
282-
if err != nil {
283-
return err
284-
}
285-
RemoveFinalizer(m.(Object), finalizer)
286-
return nil
287-
}
288-
289262
// ContainsFinalizer checks an Object that the provided finalizer is present.
290263
func ContainsFinalizer(o Object, finalizer string) bool {
291264
f := o.GetFinalizers()

0 commit comments

Comments
 (0)