From 9f334405b69c64e8e2e71eb1c428262255b2a49c Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Mon, 4 Dec 2023 11:34:10 -0500 Subject: [PATCH] Formatting and code cleanup --- pkg/kube/snapshot/snapshot.go | 9 ++++++++- pkg/kube/snapshot/snapshot_alpha.go | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/kube/snapshot/snapshot.go b/pkg/kube/snapshot/snapshot.go index 0cf8654fe3e..f489ca86629 100644 --- a/pkg/kube/snapshot/snapshot.go +++ b/pkg/kube/snapshot/snapshot.go @@ -169,7 +169,14 @@ func isTransientError(err error) bool { return transientErrorRegexp.MatchString(err.Error()) } -func waitOnReadyToUse(ctx context.Context, dynCli dynamic.Interface, snapGVR schema.GroupVersionResource, snapshotName, namespace string, isReadyFunc func(*unstructured.Unstructured) (bool, error)) error { +func waitOnReadyToUse( + ctx context.Context, + dynCli dynamic.Interface, + snapGVR schema.GroupVersionResource, + snapshotName, + namespace string, + isReadyFunc func(*unstructured.Unstructured) (bool, error), +) error { retries := 100 return poll.WaitWithRetries(ctx, retries, isTransientError, func(context.Context) (bool, error) { us, err := dynCli.Resource(snapGVR).Namespace(namespace).Get(ctx, snapshotName, metav1.GetOptions{}) diff --git a/pkg/kube/snapshot/snapshot_alpha.go b/pkg/kube/snapshot/snapshot_alpha.go index da76389c778..e1bc3c70e27 100644 --- a/pkg/kube/snapshot/snapshot_alpha.go +++ b/pkg/kube/snapshot/snapshot_alpha.go @@ -331,7 +331,6 @@ func isReadyToUseAlpha(us *unstructured.Unstructured) (bool, error) { // WaitOnReadyToUse will block until the Volumesnapshot in namespace 'namespace' with name 'snapshotName' // has status 'ReadyToUse' or 'ctx.Done()' is signalled. -// FIXME: merge this with beta wait func (sna *SnapshotAlpha) WaitOnReadyToUse(ctx context.Context, snapshotName, namespace string) error { return waitOnReadyToUse(ctx, sna.dynCli, v1alpha1.VolSnapGVR, snapshotName, namespace, isReadyToUseAlpha) }