rgw: rgw account deletion should remove account from ceph

currently there was a bug in the code where it didnt removed
the account from the ceph cluster during intial intialize

Signed-off-by: parth-gr <partharora1010@gmail.com>
(cherry picked from commit cca7020f0b)
This commit is contained in:
parth-gr
2026-07-20 20:12:38 +00:00
committed by Mergify
parent 8f43115c69
commit 3010491f03
@@ -205,6 +205,14 @@ func (r *ReconcileObjectStoreAccount) reconcile(request reconcile.Request) (reco
opsCtx, objectStore, err := object.InitializeObjectStoreContext(r.context, r.clusterInfo, r.client, r.opManagerContext, cephObjectStoreAccount.Spec.Store, newMultisiteAdminOpsCtxFunc)
if err != nil {
if !cephObjectStoreAccount.GetDeletionTimestamp().IsZero() {
log.NamedDebug(request.NamespacedName, logger, "deleting object store account")
r.recorder.Eventf(cephObjectStoreAccount, nil, corev1.EventTypeNormal, string(cephv1.ReconcileStarted), string(cephv1.ReconcileStarted), "deleting CephObjectStoreAccount %q", cephObjectStoreAccount.Name)
err := r.deleteAccount(cephObjectStoreAccount)
if err != nil {
return reconcile.Result{}, *cephObjectStoreAccount, errors.Wrapf(err, "failed to delete ceph object store account %q", cephObjectStoreAccount.Name)
}
// Remove finalizer
err = opcontroller.RemoveFinalizer(r.opManagerContext, r.client, cephObjectStoreAccount)
if err != nil {