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>
This commit is contained in:
Madhu Rajanna 2022-10-27 16:49:42 +02:00 committed by mergify[bot]
parent f19805a40b
commit 019628c8c2

View File

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