diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index a72c33638..5a3f076e9 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -727,7 +727,6 @@ jobs: yq w -i -d1 cluster-test.yaml spec.dashboard.enabled false yq w -i -d1 cluster-test.yaml spec.storage.useAllDevices false yq w -i -d1 cluster-test.yaml spec.storage.deviceFilter ${BLOCK}1 - yq w -i -d1 cluster-test.yaml spec.cephVersion.image ceph/daemon-base:latest-pacific-devel kubectl create -f cluster-test.yaml -f rbdmirror.yaml -f filesystem-mirror.yaml -f toolbox.yaml # cephfs-mirroring is a push operation diff --git a/pkg/daemon/ceph/client/filesystem_mirror.go b/pkg/daemon/ceph/client/filesystem_mirror.go index 1d6ba98d5..dfe6151cc 100644 --- a/pkg/daemon/ceph/client/filesystem_mirror.go +++ b/pkg/daemon/ceph/client/filesystem_mirror.go @@ -79,6 +79,10 @@ func DisableFilesystemSnapshotMirror(context *clusterd.Context, clusterInfo *Clu // Run command output, err := cmd.Run() if err != nil { + if code, err := exec.ExtractExitCode(err); err == nil && code == int(syscall.ENOTSUP) { + logger.Debug("filesystem mirroring is not enabled, nothing to disable") + return nil + } return errors.Wrapf(err, "failed to disable ceph filesystem snapshot mirror for filesystem %q. %s", filesystem, output) } diff --git a/pkg/operator/ceph/file/controller.go b/pkg/operator/ceph/file/controller.go index ed6db4e48..4d0b3fe9f 100644 --- a/pkg/operator/ceph/file/controller.go +++ b/pkg/operator/ceph/file/controller.go @@ -31,6 +31,7 @@ import ( "github.com/rook/rook/pkg/operator/ceph/cluster/mon" opconfig "github.com/rook/rook/pkg/operator/ceph/config" opcontroller "github.com/rook/rook/pkg/operator/ceph/controller" + "github.com/rook/rook/pkg/operator/ceph/file/mirror" "github.com/rook/rook/pkg/operator/k8sutil" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -289,9 +290,7 @@ func (r *ReconcileCephFilesystem) reconcile(request reconcile.Request) (reconcil } // Enable mirroring if needed - // TODO: change me to 16.2.5 once it's out, in the mean this allows us to run the CI and validate the code - // if r.clusterInfo.CephVersion.IsAtLeast(mirror.PeerAdditionMinVersion) { - if r.clusterInfo.CephVersion.IsAtLeastPacific() { + if r.clusterInfo.CephVersion.IsAtLeast(mirror.PeerAdditionMinVersion) { // Disable mirroring on that filesystem if needed if cephFilesystem.Spec.Mirroring != nil { if !cephFilesystem.Spec.Mirroring.Enabled { diff --git a/pkg/operator/ceph/file/mirror/config.go b/pkg/operator/ceph/file/mirror/config.go index 4314c51a8..2edc5bdf8 100644 --- a/pkg/operator/ceph/file/mirror/config.go +++ b/pkg/operator/ceph/file/mirror/config.go @@ -41,8 +41,7 @@ const ( var ( // PeerAdditionMinVersion This version includes a number of fixes for snapshots and mirror status - // TODO change me to 16.2.5 - PeerAdditionMinVersion = version.CephVersion{Major: 16, Minor: 2, Extra: 2} + PeerAdditionMinVersion = version.CephVersion{Major: 16, Minor: 2, Extra: 5} ) // daemonConfig for a single rbd-mirror diff --git a/pkg/util/retry.go b/pkg/util/retry.go index 3c15141ea..27622e805 100644 --- a/pkg/util/retry.go +++ b/pkg/util/retry.go @@ -36,7 +36,7 @@ func Retry(maxRetries int, delay time.Duration, f func() error) error { tries++ if tries > maxRetries { - return fmt.Errorf("max retries exceeded, last err: %+v", err) + return fmt.Errorf("max retries exceeded, last err: %v", err) } logger.Infof("retrying after %v, last error: %v", delay, err)