diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index db9749eed..ed48bc43a 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -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 }