rbd: use correct radosnamespace

Issue: When an RBD image is created in a non-default namespace,
the OMAP data for the PersistentVolume fails to regenerate
because it still attempts to locate the RBD image in the default
namespace.

This commit ensures the correct radosNamespace is retrieved from
the ceph-csi-config.

Signed-off-by: Praveen M <m.praveen@ibm.com>
(cherry picked from commit 8a66575825)
This commit is contained in:
Praveen M 2025-01-21 15:33:56 +05:30 committed by mergify[bot]
parent 4429a992b2
commit fb0f1643fe

View File

@ -608,6 +608,10 @@ func RegenerateJournal(
if err != nil { if err != nil {
return "", err return "", err
} }
rbdVol.RadosNamespace, err = util.GetRBDRadosNamespace(util.CsiConfigFile, rbdVol.ClusterID)
if err != nil {
return "", err
}
if rbdVol.Pool, ok = volumeAttributes["pool"]; !ok { if rbdVol.Pool, ok = volumeAttributes["pool"]; !ok {
return "", errors.New("required 'pool' parameter missing in volume attributes") return "", errors.New("required 'pool' parameter missing in volume attributes")