From 1f8f71b396013c731d333fcbbdae1d9364ae16aa Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Wed, 23 Feb 2022 16:01:46 -0700 Subject: [PATCH] file: allow filesystem removal even with failures If the filesystem is in a bad state such as never being created successfully in the first place, the filesystem removal will continuously fail and prevent the CR from being removed. Thus, we treat the filesystem removal as a best effort and log the issue instead of failing the uninstall reconcile. Signed-off-by: Travis Nielsen --- pkg/operator/ceph/file/filesystem.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/operator/ceph/file/filesystem.go b/pkg/operator/ceph/file/filesystem.go index 2a6c403fc..e5fb794f1 100644 --- a/pkg/operator/ceph/file/filesystem.go +++ b/pkg/operator/ceph/file/filesystem.go @@ -104,13 +104,15 @@ func deleteFilesystem( // The K8s resources will already be removed with the K8s owner references if err := downFilesystem(context, clusterInfo, fs.Name); err != nil { // If the fs isn't deleted from Ceph, leave the daemons so it can still be used. - return errors.Wrapf(err, "failed to down filesystem %q", fs.Name) + // Log the error for best effort and continue + logger.Warningf("continuing to remove filesystem CR even though downing the filesystem failed. %v", err) } // Permanently remove the filesystem if it was created by rook and the spec does not prevent it. if len(fs.Spec.DataPools) != 0 && !fs.Spec.PreserveFilesystemOnDelete { if err := cephclient.RemoveFilesystem(context, clusterInfo, fs.Name, fs.Spec.PreservePoolsOnDelete); err != nil { - return errors.Wrapf(err, "failed to remove filesystem %q", fs.Name) + // log the error for best effort and continue + logger.Warningf("continuing to remove filesystem CR even though removal failed. %v", err) } } return nil