ceph: introduced unsupported releases
These are a collection of unstable ceph release that are not recommended for production. It is recommended to rollback to the previous or upgrading to the next one if possible. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
1 parent
8631eef1f7
commit
64fe9f7685
3 files changed
+58
-5
No files matched your search
@@ -164,6 +164,10 @@ func (c *cluster) validateCephVersion(version *cephver.CephVersion) error {
|
||||
}
|
||||
logger.Warningf("unsupported ceph version detected: %q, pursuing", version)
|
||||
}
|
||||
|
||||
if version.Unsupported() {
|
||||
logger.Errorf("UNSUPPORTED: ceph version %q detected, it is recommended to rollback to the previous pin-point stable release, pursuing anyways", version)
|
||||
}
|
||||
}
|
||||
|
||||
// The following tries to determine if the operator can proceed with an upgrade because we come from an OnAdd() call
|
||||
|
||||
@@ -47,9 +47,14 @@ var (
|
||||
// Pacific Ceph version
|
||||
Pacific = CephVersion{16, 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}
|
||||
|
||||
// supportedVersions are production-ready versions that rook supports
|
||||
supportedVersions = []CephVersion{Nautilus, Octopus}
|
||||
unsupportedVersions = []CephVersion{Pacific}
|
||||
supportedVersions = []CephVersion{Nautilus, Octopus}
|
||||
|
||||
// unsupportedVersions are possibly Ceph pin-point release that introduced breaking changes and not recommended
|
||||
unsupportedVersions = []CephVersion{cephVolumeLVMDiskSortingCephVersion}
|
||||
|
||||
// for parsing the output of `ceph --version`
|
||||
versionPattern = regexp.MustCompile(`ceph version (\d+)\.(\d+)\.(\d+)`)
|
||||
@@ -130,10 +135,24 @@ func (v *CephVersion) Supported() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Unsupported checks if a given release is supported
|
||||
func (v *CephVersion) Unsupported() bool {
|
||||
for _, sv := range unsupportedVersions {
|
||||
if v.isExactly(sv) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (v *CephVersion) isRelease(other CephVersion) bool {
|
||||
return v.Major == other.Major
|
||||
}
|
||||
|
||||
func (v *CephVersion) isExactly(other CephVersion) bool {
|
||||
return v.Major == other.Major && v.Minor == other.Minor && v.Extra == other.Extra
|
||||
}
|
||||
|
||||
// IsNautilus checks if the Ceph version is Nautilus
|
||||
func (v *CephVersion) IsNautilus() bool {
|
||||
return v.isRelease(Nautilus)
|
||||
|
||||
@@ -97,9 +97,6 @@ func TestSupported(t *testing.T) {
|
||||
for _, v := range supportedVersions {
|
||||
assert.True(t, v.Supported())
|
||||
}
|
||||
for _, v := range unsupportedVersions {
|
||||
assert.False(t, v.Supported())
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsRelease(t *testing.T) {
|
||||
@@ -203,3 +200,36 @@ func TestValidateCephVersionsBetweenLocalAndExternalClusters(t *testing.T) {
|
||||
err = ValidateCephVersionsBetweenLocalAndExternalClusters(localCephVersion, externalCephVersion)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestCephVersion_Unsupported(t *testing.T) {
|
||||
type fields struct {
|
||||
Major int
|
||||
Minor int
|
||||
Extra int
|
||||
Build int
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
want bool
|
||||
}{
|
||||
{"supported", fields{Major: 14, Minor: 2, Extra: 1, Build: 0}, false},
|
||||
{"supported", fields{Major: 14, Minor: 2, Extra: 12, Build: 0}, false},
|
||||
{"supported", fields{Major: 15, Minor: 2, Extra: 1, Build: 0}, false},
|
||||
{"supported", fields{Major: 15, Minor: 2, Extra: 6, Build: 0}, false},
|
||||
{"unsupported", fields{Major: 14, Minor: 2, Extra: 13, Build: 0}, true},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := &CephVersion{
|
||||
Major: tt.fields.Major,
|
||||
Minor: tt.fields.Minor,
|
||||
Extra: tt.fields.Extra,
|
||||
Build: tt.fields.Build,
|
||||
}
|
||||
if got := v.Unsupported(); got != tt.want {
|
||||
t.Errorf("CephVersion.Unsupported() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user