Skip to content

Commit

Permalink
Formatting and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Dec 4, 2023
1 parent fbd6e78 commit 9f33440
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pkg/kube/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down
1 change: 0 additions & 1 deletion pkg/kube/snapshot/snapshot_alpha.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9f33440

Please sign in to comment.