// Deletes any bucket api object or an array of bucket or bucket access objects.
// This is used by bucket request and bucket access request unit tests
Deletes any bucket api object or an array of bucket or bucket access objects.
This is used by bucket request and bucket access request unit tests
// Deletes any bucket api object or an array of bucket or bucket access objects . // This is used by bucket request and bucket access request unit tests
func DeleteObjects(ctx context.Context, client bucketclientset.Interface, objs ...interface{}) {
	for _, obj := range objs {
		switch t := obj.(type) {
		case types.Bucket:
			client.ObjectstorageV1alpha1().Buckets().Delete(ctx, obj.(types.Bucket).Name, metav1.DeleteOptions{})
		case types.BucketRequest:
			client.ObjectstorageV1alpha1().BucketRequests(obj.(types.BucketRequest).Namespace).Delete(ctx, obj.(types.BucketRequest).Name, metav1.DeleteOptions{})
		case types.BucketClass:
			client.ObjectstorageV1alpha1().BucketClasses().Delete(ctx, obj.(types.BucketClass).Name, metav1.DeleteOptions{})
		case []types.Bucket:
			for _, a := range obj.([]types.Bucket) {
				DeleteObjects(ctx, client, a)
			}
		case types.BucketAccess:
			client.ObjectstorageV1alpha1().BucketAccesses().Delete(ctx, obj.(types.BucketAccess).Name, metav1.DeleteOptions{})
		case types.BucketAccessRequest:
			client.ObjectstorageV1alpha1().BucketAccessRequests(obj.(types.BucketAccessRequest).Namespace).Delete(ctx, obj.(types.BucketAccessRequest).Name, metav1.DeleteOptions{})
		case types.BucketAccessClass:
			client.ObjectstorageV1alpha1().BucketAccessClasses().Delete(ctx, obj.(types.BucketAccessClass).Name, metav1.DeleteOptions{})
		case []types.BucketAccess:
			for _, a := range obj.([]types.BucketAccess) {
				DeleteObjects(ctx, client, a)
			}
		default:
			glog.Errorf("Unknown Obj of type %v", t)
		}
	}
}
func DeleteObjects ( ctx context . Context , client bucketclientset . Interface , objs ... interface { } ) { for _ , obj := range objs { switch t := obj . ( type ) { case types . Bucket : client . ObjectstorageV1alpha1 ( ) . Buckets ( ) . Delete ( ctx , obj . ( types . Bucket ) . Name , metav1 . DeleteOptions { } ) case types . BucketRequest : client . ObjectstorageV1alpha1 ( ) . BucketRequests ( obj . ( types . BucketRequest ) . Namespace ) . Delete ( ctx , obj . ( types . BucketRequest ) . Name , metav1 . DeleteOptions { } ) case types . BucketClass : client . ObjectstorageV1alpha1 ( ) . BucketClasses ( ) . Delete ( ctx , obj . ( types . BucketClass ) . Name , metav1 . DeleteOptions { } ) case [ ] types . Bucket : for _ , a := range obj . ( [ ] types . Bucket ) { DeleteObjects ( ctx , client , a ) } case types . BucketAccess : client . ObjectstorageV1alpha1 ( ) . BucketAccesses ( ) . Delete ( ctx , obj . ( types . BucketAccess ) . Name , metav1 . DeleteOptions { } ) case types . BucketAccessRequest : client . ObjectstorageV1alpha1 ( ) . BucketAccessRequests ( obj . ( types . BucketAccessRequest ) . Namespace ) . Delete ( ctx , obj . ( types . BucketAccessRequest ) . Name , metav1 . DeleteOptions { } ) case types . BucketAccessClass : client . ObjectstorageV1alpha1 ( ) . BucketAccessClasses ( ) . Delete ( ctx , obj . ( types . BucketAccessClass ) . Name , metav1 . DeleteOptions { } ) case [ ] types . BucketAccess : for _ , a := range obj . ( [ ] types . BucketAccess ) { DeleteObjects ( ctx , client , a ) } default : glog . Errorf ( " " , t ) } } }
Deletes any bucket api object or an array of bucket or bucket access objects.
Deletes any bucket api object or an array of bucket or bucket access objects .