mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-01 09:10:02 +00:00
Cleanup unused test functions - cont-ed
Following up the work started in 0c0bd6d this is further cleaning up the
test/utils directory getting rid of unused functions.
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
@@ -56,14 +55,3 @@ func DeleteResource(c clientset.Interface, kind schema.GroupKind, namespace, nam
|
||||
return fmt.Errorf("unsupported kind when deleting: %v", kind)
|
||||
}
|
||||
}
|
||||
|
||||
func DeleteResourceWithRetries(c clientset.Interface, kind schema.GroupKind, namespace, name string, options metav1.DeleteOptions) error {
|
||||
deleteFunc := func() (bool, error) {
|
||||
err := DeleteResource(c, kind, namespace, name, options)
|
||||
if err == nil || apierrors.IsNotFound(err) {
|
||||
return true, nil
|
||||
}
|
||||
return false, fmt.Errorf("failed to delete object with non-retriable error: %v", err)
|
||||
}
|
||||
return RetryWithExponentialBackOff(deleteFunc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user