From 9f8404e3300a1918b535c93a06284939f1ea8b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 21 Jan 2021 08:50:41 +0100 Subject: [PATCH] ceph: add quincy version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quincy just started https://github.com/ceph/ceph/pull/38996 so let's add it to our version code. Signed-off-by: Sébastien Han --- pkg/operator/ceph/version/version.go | 14 ++++++++++++++ pkg/operator/ceph/version/version_test.go | 2 ++ 2 files changed, 16 insertions(+) diff --git a/pkg/operator/ceph/version/version.go b/pkg/operator/ceph/version/version.go index ceb1d0836..7290f471b 100644 --- a/pkg/operator/ceph/version/version.go +++ b/pkg/operator/ceph/version/version.go @@ -46,6 +46,8 @@ var ( Octopus = CephVersion{15, 0, 0, 0} // Pacific Ceph version Pacific = CephVersion{16, 0, 0, 0} + // Quincy Ceph version + Quincy = CephVersion{17, 0, 0, 0} // cephVolumeLVMDiskSortingCephVersion introduced a major regression in c-v and thus is not suitable for production cephVolumeLVMDiskSortingCephVersion = CephVersion{Major: 14, Minor: 2, Extra: 13} @@ -86,6 +88,8 @@ func (v *CephVersion) ReleaseName() string { return "octopus" case Pacific.Major: return "pacific" + case Quincy.Major: + return "quincy" default: return unknownVersionString } @@ -170,6 +174,11 @@ func (v *CephVersion) IsPacific() bool { return v.isRelease(Pacific) } +// IsQuincy checks if the Ceph version is Quincy +func (v *CephVersion) IsQuincy() bool { + return v.isRelease(Quincy) +} + // IsAtLeast checks a given Ceph version is at least a given one func (v *CephVersion) IsAtLeast(other CephVersion) bool { if v.Major > other.Major { @@ -193,6 +202,11 @@ func (v *CephVersion) IsAtLeast(other CephVersion) bool { return true } +// IsAtLeastQuincy check that the Ceph version is at least Quincy +func (v *CephVersion) IsAtLeastQuincy() bool { + return v.IsAtLeast(Quincy) +} + // IsAtLeastPacific check that the Ceph version is at least Pacific func (v *CephVersion) IsAtLeastPacific() bool { return v.IsAtLeast(Pacific) diff --git a/pkg/operator/ceph/version/version_test.go b/pkg/operator/ceph/version/version_test.go index a6efbd3c2..51425d41f 100644 --- a/pkg/operator/ceph/version/version_test.go +++ b/pkg/operator/ceph/version/version_test.go @@ -102,6 +102,8 @@ func TestSupported(t *testing.T) { func TestIsRelease(t *testing.T) { assert.True(t, Nautilus.isRelease(Nautilus)) assert.True(t, Octopus.isRelease(Octopus)) + assert.True(t, Pacific.isRelease(Pacific)) + assert.True(t, Quincy.isRelease(Quincy)) assert.False(t, Octopus.isRelease(Nautilus))