// GetBuckets will wait and fetch expected number of buckets created by the test
// This is used by bucket request unit tests
GetBuckets will wait and fetch expected number of buckets created by the test
This is used by bucket request unit tests
// GetBuckets will wait and fetch expected number of buckets created by the test // This is used by bucket request unit tests
func GetBuckets(ctx context.Context, client bucketclientset.Interface, numExpected int) *types.BucketList {
	bucketList, err := client.ObjectstorageV1alpha1().Buckets().List(ctx, metav1.ListOptions{})
	if len(bucketList.Items) > 0 {
		return bucketList
	}
	numtimes := 0
	for numtimes < 10 {
		bucketList, err = client.ObjectstorageV1alpha1().Buckets().List(ctx, metav1.ListOptions{})
		if len(bucketList.Items) >= numExpected {
			return bucketList
		} else {
			glog.Errorf("Failed to fetch the bucket created %v", err)
		}
		numtimes++
		<-time.After(time.Duration(numtimes) * time.Second)
	}
	return &types.BucketList{}
}
func GetBuckets ( ctx context . Context , client bucketclientset . Interface , numExpected int ) * types . BucketList { bucketList , err := client . ObjectstorageV1alpha1 ( ) . Buckets ( ) . List ( ctx , metav1 . ListOptions { } ) if len ( bucketList . Items ) > 0 { return bucketList } numtimes := 0 for numtimes < 10 { bucketList , err = client . ObjectstorageV1alpha1 ( ) . Buckets ( ) . List ( ctx , metav1 . ListOptions { } ) if len ( bucketList . Items ) >= numExpected { return bucketList } else { glog . Errorf ( " " , err ) } numtimes ++ <- time . After ( time . Duration ( numtimes ) * time . Second ) } return & types . BucketList { } }
GetBuckets will wait and fetch expected number of buckets created by the test
This is used by bucket request unit tests
GetBuckets will wait and fetch expected number of buckets created by the test This is used by bucket request unit tests