From 8a31ac89c9fabb1f1086691c7fbb75f96a8609d9 Mon Sep 17 00:00:00 2001 From: Cyrill Troxler Date: Sun, 29 Jul 2018 16:19:26 +0200 Subject: [PATCH] Improve bucket error messages --- pkg/s3/controllerserver.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/s3/controllerserver.go b/pkg/s3/controllerserver.go index 693cb31..fe29f9c 100644 --- a/pkg/s3/controllerserver.go +++ b/pkg/s3/controllerserver.go @@ -53,17 +53,17 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol params := req.GetParameters() mounter := params[mounterTypeKey] - glog.V(5).Infof("Got a request to create bucket %s", volumeID) + glog.V(4).Infof("Got a request to create volume %s", volumeID) exists, err := cs.s3.client.bucketExists(volumeID) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to check if bucket exists: %v", err) } if exists { var b *bucket b, err = cs.s3.client.getBucket(volumeID) if err != nil { - return nil, fmt.Errorf("failed to get bucket: %v", err) + return nil, fmt.Errorf("failed to get bucket metadata: %v", err) } // Check if volume capacity requested is bigger than the already existing capacity if capacityBytes > b.CapacityBytes {