rbd: unset cluster Name metadata

unsets the cluster name metadata key and value on the RBD image

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-05-16 12:45:02 +05:30 committed by mergify[bot]
parent 2880c25fd6
commit 09a8e5e9e6

View File

@ -2028,5 +2028,11 @@ func (rv *rbdVolume) unsetAllMetadata(keys []string) error {
} }
} }
err := rv.RemoveMetadata(clusterNameKey)
// TODO: replace string comparison with errno.
if err != nil && !strings.Contains(err.Error(), "No such file or directory") {
return fmt.Errorf("failed to unset metadata key %q on %q: %w", clusterNameKey, rv, err)
}
return nil return nil
} }