From 11d51ed9b087925fcdab856c2c2e1944aca4a056 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Tue, 14 Jun 2022 18:56:46 +0530 Subject: [PATCH] cephfs: unset cluster Name metadata unsets the cluster name metadata key and value on the subvolume Signed-off-by: Prasanna Kumar Kalever --- internal/cephfs/core/metadata.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/cephfs/core/metadata.go b/internal/cephfs/core/metadata.go index f15e662c7..5096f7f78 100644 --- a/internal/cephfs/core/metadata.go +++ b/internal/cephfs/core/metadata.go @@ -78,5 +78,11 @@ func (s *subVolumeClient) UnsetAllMetadata(keys []string) error { } } + err := s.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 subvolume %v: %w", clusterNameKey, s, err) + } + return nil }