From b836aab13e990eeeee377db078535ddb028aff8c Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Wed, 10 Feb 2021 12:35:37 +0530 Subject: [PATCH] ceph: fill up endpoint for cephobjectstore user Currently endpoint is filled from `Status.Info["endpoint"]` string map for cephobjectstore user's secret and have two issues: 1.) endpoint is nil and only secureendpoint is available 2.) Chance of small race window in which endpoint is not filled before this ceph object user is handling. Signed-off-by: Jiffin Tony Thottan --- pkg/operator/ceph/object/user/controller.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/operator/ceph/object/user/controller.go b/pkg/operator/ceph/object/user/controller.go index 5bfbf105f..ade810fb6 100644 --- a/pkg/operator/ceph/object/user/controller.go +++ b/pkg/operator/ceph/object/user/controller.go @@ -309,8 +309,15 @@ func (r *ReconcileObjectStoreUser) initializeObjectStoreContext(u *cephv1.CephOb if err != nil { return errors.Wrapf(err, "Multisite failed to set on object context for object store user") } + r.objContext = objContext r.objContext.Endpoint = store.Status.Info["endpoint"] + if store.Status.Info["secureEndpoint"] != "" { + r.objContext.Endpoint = store.Status.Info["secureEndpoint"] + } + if r.objContext.Endpoint == "" { + return errors.Errorf("endpoint is missing in the status Info") + } return nil }