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 <thottanjiffin@gmail.com>
This commit is contained in:
Jiffin Tony Thottan committed 2021-02-12 10:46:30 +05:30
1 parent 09b72e4c4a
commit b836aab13e
1 file changed
+7
@@ -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
}