rbd: update namespace name in metadata

If a PV is reattached to a new PVC in a different
namespace we need to update the namespace name
in the rbd image metadata.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 019628c8c2)
This commit is contained in:
Madhu Rajanna 2022-10-27 16:49:42 +02:00 committed by mergify[bot]
parent 1f1a212ece
commit 787d54fa6a

View File

@ -622,7 +622,7 @@ func RegenerateJournal(
}
}
// Update Metadata on reattach of the same old PV
parameters := k8s.PrepareVolumeMetadata(claimName, rbdVol.Owner, "")
parameters := k8s.PrepareVolumeMetadata(claimName, owner, "")
err = rbdVol.setAllMetadata(parameters)
if err != nil {
return "", fmt.Errorf("failed to set volume metadata: %w", err)