diff --git a/pkg/operator/ceph/object/objectstore.go b/pkg/operator/ceph/object/objectstore.go index c2921ca48..291518f03 100644 --- a/pkg/operator/ceph/object/objectstore.go +++ b/pkg/operator/ceph/object/objectstore.go @@ -874,11 +874,9 @@ func getDashboardUser(context *Context) (ObjectUser, error) { SystemUser: true, } - if !context.CephClusterSpec.External.Enable { - // Retrieve RGW Dashboard credentials if some are already set - if err := retrieveDashboardAPICredentials(context, &user); err != nil { - return user, errors.Wrapf(err, "failed to retrieve RGW Dashboard credentials for %q user", DashboardUser) - } + // Retrieve RGW Dashboard credentials if some are already set + if err := retrieveDashboardAPICredentials(context, &user); err != nil { + return user, errors.Wrapf(err, "failed to retrieve RGW Dashboard credentials for %q user", DashboardUser) } return user, nil diff --git a/pkg/operator/ceph/object/rgw.go b/pkg/operator/ceph/object/rgw.go index a5d6eda63..87628ff88 100644 --- a/pkg/operator/ceph/object/rgw.go +++ b/pkg/operator/ceph/object/rgw.go @@ -226,7 +226,7 @@ func (c *clusterConfig) startRGWPods(realmName, zoneGroupName, zoneName string) func (c *clusterConfig) deleteStore() { logger.Infof("deleting object store %q from namespace %q", c.store.Name, c.store.Namespace) - if !c.clusterSpec.External.Enable { + if !c.store.Spec.IsExternal() { // Delete rgw CephX keys and configuration in centralized mon database for i := 0; i < int(c.store.Spec.Gateway.Instances); i++ { daemonLetterID := k8sutil.IndexToName(i) diff --git a/pkg/operator/ceph/object/user/controller.go b/pkg/operator/ceph/object/user/controller.go index a57a15f50..225ef1ae7 100644 --- a/pkg/operator/ceph/object/user/controller.go +++ b/pkg/operator/ceph/object/user/controller.go @@ -478,15 +478,15 @@ func (r *ReconcileObjectStoreUser) reconcileCephUserSecret(cephObjectStoreUser * } func (r *ReconcileObjectStoreUser) objectStoreInitialized(cephObjectStoreUser *cephv1.CephObjectStoreUser) error { - _, err := r.getObjectStore(cephObjectStoreUser.Spec.Store) + cephObjectStore, err := r.getObjectStore(cephObjectStoreUser.Spec.Store) if err != nil { return err } logger.Debug("CephObjectStore exists") - // If the cluster is external just return + // If the rgw is external just return // since there are no pods running - if r.cephClusterSpec.External.Enable { + if cephObjectStore.Spec.IsExternal() { return nil } @@ -571,10 +571,8 @@ func (r *ReconcileObjectStoreUser) validateUser(u *cephv1.CephObjectStoreUser) e if u.Namespace == "" { return errors.New("missing namespace") } - if !r.cephClusterSpec.External.Enable { - if u.Spec.Store == "" { - return errors.New("missing store") - } + if u.Spec.Store == "" { + return errors.New("missing store") } return nil }