rbd: unset metadata if setmetadata is false

We need to unset the metadata on the clone
and restore PVC if the parent PVC was created
when setmetadata was set to true and it was
set to false when restore and clone pvc was
created.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-11-11 12:45:46 +01:00
committed by mergify[bot]
parent ad36f13e92
commit d12400aa9c
2 changed files with 196 additions and 4 deletions

View File

@ -2122,10 +2122,6 @@ func (rv *rbdVolume) setAllMetadata(parameters map[string]string) error {
// unsetAllMetadata unset all the metadata from arg keys on RBD image.
func (rv *rbdVolume) unsetAllMetadata(keys []string) error {
if !rv.EnableMetadata {
return nil
}
for _, key := range keys {
err := rv.RemoveMetadata(key)
// TODO: replace string comparison with errno.