From ab607075dac84cd90fcf9e0e56bc5fd75fefcc40 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Fri, 15 May 2020 15:36:12 +0530 Subject: [PATCH] ceph: handles an user creation error if the store is missing Currently if object store is missing user creation fails without throwing any error. Here the access and secret key values will be checked post the creation command Signed-off-by: Jiffin Tony Thottan --- pkg/operator/ceph/object/user.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/operator/ceph/object/user.go b/pkg/operator/ceph/object/user.go index defb66762..b5edf4699 100644 --- a/pkg/operator/ceph/object/user.go +++ b/pkg/operator/ceph/object/user.go @@ -81,6 +81,8 @@ func decodeUser(data string) (*ObjectUser, int, error) { if len(user.Keys) > 0 { rookUser.AccessKey = &user.Keys[0].AccessKey rookUser.SecretKey = &user.Keys[0].SecretKey + } else { + return nil, RGWErrorBadData, errors.New("AccessKey and SecretKey are missing") } return &rookUser, RGWErrorNone, nil