Merge pull request #10425 from thotz/add-external-rgw-check-properly

object: add the external rgw server check properly
This commit is contained in:
Blaine Gardner authored and GitHub committed 2022-07-28 15:05:37 -06:00
commit 2b3adbeaf1
3 files changed
+9 -13

No files matched your search

+3 -5
View File
@@ -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
+1 -1
View File
@@ -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)
+5 -7
View File
@@ -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
}