rbd: unset snapshot metadata on CreateVolume From snapshot

Unset the snapshot metadata from the rbd image created from the snapshot

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-04-04 17:26:13 +05:30 committed by mergify[bot]
parent d89c5fb39f
commit e0f34a6d60

View File

@ -591,6 +591,12 @@ func (cs *ControllerServer) createVolumeFromSnapshot(
return err
}
err = rbdVol.unsetAllMetadata(k8s.GetSnapshotMetadataKeys())
if err != nil {
log.ErrorLog(ctx, "failed to unset snapshot metadata on rbd image %q: %v", rbdVol, err)
return err
}
log.DebugLog(ctx, "create volume %s from snapshot %s", rbdVol, rbdSnap)