mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-12 17:30:19 +00:00
e2e: cleanup StorageClass create retry
StorageClasses are cluster resources, not namespaced; there is no need to log the namespace of a StorageClass. When creating a StorageClass, NotFound is not an error that will be returned, not need to check for it. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
b235c171ba
commit
fcb4701a06
@ -26,7 +26,6 @@ import (
|
|||||||
|
|
||||||
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1"
|
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
apierrs "k8s.io/apimachinery/pkg/api/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
@ -109,13 +108,10 @@ func createCephfsStorageClass(
|
|||||||
return wait.PollImmediate(poll, timeout, func() (bool, error) {
|
return wait.PollImmediate(poll, timeout, func() (bool, error) {
|
||||||
_, err = c.StorageV1().StorageClasses().Create(context.TODO(), &sc, metav1.CreateOptions{})
|
_, err = c.StorageV1().StorageClasses().Create(context.TODO(), &sc, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Logf("error creating StorageClass %q in namespace %q: %v", sc.Name, sc.Namespace, err)
|
e2elog.Logf("error creating StorageClass %q: %v", sc.Name, err)
|
||||||
if isRetryableAPIError(err) {
|
if isRetryableAPIError(err) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if apierrs.IsNotFound(err) {
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return false, fmt.Errorf("failed to create StorageClass %q: %w", sc.Name, err)
|
return false, fmt.Errorf("failed to create StorageClass %q: %w", sc.Name, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user