Unverified Commit 9a3dc52a authored by travisn's avatar travisn
Browse files

ceph: minimum version allowed is mimic 13.2.4


With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.
Signed-off-by: default avatartravisn <tnielsen@redhat.com>
parent 258a6655
Showing with 19 additions and 89 deletions
+19 -89
......@@ -175,12 +175,10 @@ func TestHttpBindFix(t *testing.T) {
{hasFix: false, ver: cephver.CephVersion{Major: 14, Minor: 1, Extra: 0}},
// versions when the fix was introduced
{hasFix: true, ver: cephver.CephVersion{Major: 12, Minor: 2, Extra: 12}},
{hasFix: true, ver: cephver.CephVersion{Major: 13, Minor: 2, Extra: 6}},
{hasFix: true, ver: cephver.CephVersion{Major: 14, Minor: 1, Extra: 1}},
// versions after the fix
{hasFix: true, ver: cephver.CephVersion{Major: 12, Minor: 2, Extra: 13}},
{hasFix: true, ver: cephver.CephVersion{Major: 13, Minor: 2, Extra: 7}},
{hasFix: true, ver: cephver.CephVersion{Major: 14, Minor: 1, Extra: 2}},
{hasFix: true, ver: cephver.CephVersion{Major: 15, Minor: 2, Extra: 0}},
......@@ -190,9 +188,6 @@ func TestHttpBindFix(t *testing.T) {
c.clusterInfo.CephVersion = test.ver
expectedInitContainers := 0
if c.clusterInfo.CephVersion.IsLuminous() {
expectedInitContainers += 1
}
if !test.hasFix {
expectedInitContainers += 2
}
......
......@@ -29,19 +29,8 @@ func getClusterObject(obj interface{}) (cluster *cephv1.CephCluster, err error)
if ok {
// the cluster object is of the latest type, simply return it
cluster = cluster.DeepCopy()
setClusterDefaults(cluster)
return cluster, nil
}
return nil, fmt.Errorf("not a known cluster object: %+v", obj)
}
func setClusterDefaults(cluster *cephv1.CephCluster) {
// The ceph version image should be set in the CRD.
// If/when the v1beta1 CRD is converted to v1, we could set this permanently during the conversion instead of
// setting this default in memory every time we run the operator.
if cluster.Spec.CephVersion.Image == "" {
logger.Infof("setting default luminous image: %s", cephv1.DefaultLuminousImage)
cluster.Spec.CephVersion.Image = cephv1.DefaultLuminousImage
}
}
......@@ -34,11 +34,3 @@ func TestGetClusterObject(t *testing.T) {
assert.Nil(t, cluster)
assert.NotNil(t, err)
}
func TestDefaultClusterValues(t *testing.T) {
// the default ceph version should be set
cluster, err := getClusterObject(&cephv1.CephCluster{})
assert.NotNil(t, cluster)
assert.Nil(t, err)
assert.Equal(t, cephv1.DefaultLuminousImage, cluster.Spec.CephVersion.Image)
}
......@@ -135,7 +135,7 @@ func (c *Cluster) makeDeploymentPVC(m *monConfig) (*v1.PersistentVolumeClaim, er
*/
func (c *Cluster) makeMonPod(monConfig *monConfig, hostname string) *v1.Pod {
logger.Debug("monConfig: %+v", monConfig)
logger.Debugf("monConfig: %+v", monConfig)
podSpec := v1.PodSpec{
InitContainers: []v1.Container{
c.makeChownInitContainer(monConfig),
......
......@@ -109,11 +109,7 @@ func (s *Store) CreateOrUpdate(clusterInfo *cephconfig.ClusterInfo) error {
/*
TODO:
if Luminous {
store config file in config map as above
} else if Mimic + {
set config values with `ceph config assimilage-conf t` after at least one mon is active
}
*/
return nil
......
......@@ -100,7 +100,6 @@ func (c *Cluster) makeMdsDaemonContainer(mdsConfig *mdsConfig) v1.Container {
}
// Set mds cache memory limit to the best appropriate value
// This is new in Luminous so there is no need to check for a Ceph version
if !c.fs.Spec.MetadataServer.Resources.Limits.Memory().IsZero() {
mdsCacheMemoryLimit := float64(c.fs.Spec.MetadataServer.Resources.Limits.Memory().Value()) * mdsCacheMemoryLimitFactor
args = append(args, config.NewFlag("mds-cache-memory-limit", strconv.Itoa(int(mdsCacheMemoryLimit))))
......
......@@ -34,8 +34,8 @@ const (
)
var (
// Luminous Ceph version
Luminous = CephVersion{12, 0, 0}
// Minimum supported version is 13.2.4 where ceph-volume is supported
Minimum = CephVersion{13, 2, 4}
// Mimic Ceph version
Mimic = CephVersion{13, 0, 0}
// Nautilus Ceph version
......@@ -44,7 +44,7 @@ var (
Octopus = CephVersion{15, 0, 0}
// supportedVersions are production-ready versions that rook supports
supportedVersions = []CephVersion{Luminous, Mimic, Nautilus}
supportedVersions = []CephVersion{Mimic, Nautilus}
unsupportedVersions = []CephVersion{Octopus}
// allVersions includes all supportedVersions as well as unreleased versions that are being tested with rook
allVersions = append(supportedVersions, unsupportedVersions...)
......@@ -73,8 +73,6 @@ func (v *CephVersion) ReleaseName() string {
return "nautilus"
case Mimic.Major:
return "mimic"
case Luminous.Major:
return "luminous"
default:
return unknownVersionString
}
......@@ -119,11 +117,6 @@ func (v *CephVersion) isRelease(other CephVersion) bool {
return v.Major == other.Major
}
// IsLuminous checks if the Ceph version is Luminous
func (v *CephVersion) IsLuminous() bool {
return v.isRelease(Luminous)
}
// IsMimic checks if the Ceph version is Mimic
func (v *CephVersion) IsMimic() bool {
return v.isRelease(Mimic)
......
......@@ -26,7 +26,6 @@ import (
func TestToString(t *testing.T) {
assert.Equal(t, "14.0.0 nautilus", fmt.Sprintf("%s", &Nautilus))
assert.Equal(t, "13.0.0 mimic", fmt.Sprintf("%s", &Mimic))
assert.Equal(t, "12.0.0 luminous", fmt.Sprintf("%s", &Luminous))
expected := fmt.Sprintf("-1.0.0 %s", unknownVersionString)
assert.Equal(t, expected, fmt.Sprintf("%s", &CephVersion{-1, 0, 0}))
......@@ -35,13 +34,11 @@ func TestToString(t *testing.T) {
func TestCephVersionFormatted(t *testing.T) {
assert.Equal(t, "ceph version 14.0.0 nautilus", Nautilus.CephVersionFormatted())
assert.Equal(t, "ceph version 13.0.0 mimic", Mimic.CephVersionFormatted())
assert.Equal(t, "ceph version 12.0.0 luminous", Luminous.CephVersionFormatted())
}
func TestReleaseName(t *testing.T) {
assert.Equal(t, "nautilus", Nautilus.ReleaseName())
assert.Equal(t, "mimic", Mimic.ReleaseName())
assert.Equal(t, "luminous", Luminous.ReleaseName())
ver := CephVersion{-1, 0, 0}
assert.Equal(t, unknownVersionString, ver.ReleaseName())
}
......@@ -55,13 +52,13 @@ func extractVersionHelper(t *testing.T, text string, major, minor, extra int) {
func TestExtractVersion(t *testing.T) {
// release build
v0c := "ceph version 12.2.8 (ae699615bac534ea496ee965ac6192cb7e0e07c0) luminous (stable)"
v0c := "ceph version 13.2.6 (ae699615bac534ea496ee965ac6192cb7e0e07c1) mimic (stable)"
v0d := `
root@7a97f5a78bc6:/# ceph --version
ceph version 12.2.8 (ae699615bac534ea496ee965ac6192cb7e0e07c0) luminous (stable)
ceph version 13.2.6 (ae699615bac534ea496ee965ac6192cb7e0e07c1) mimic (stable)
`
extractVersionHelper(t, v0c, 12, 2, 8)
extractVersionHelper(t, v0d, 12, 2, 8)
extractVersionHelper(t, v0c, 13, 2, 6)
extractVersionHelper(t, v0d, 13, 2, 6)
// development build
v1c := "ceph version 14.1.33-403-g7ba6bece41"
......@@ -105,19 +102,11 @@ func TestSupported(t *testing.T) {
}
func TestIsRelease(t *testing.T) {
assert.True(t, Luminous.isRelease(Luminous))
assert.True(t, Mimic.isRelease(Mimic))
assert.True(t, Nautilus.isRelease(Nautilus))
assert.False(t, Luminous.isRelease(Mimic))
assert.False(t, Luminous.isRelease(Nautilus))
assert.False(t, Mimic.isRelease(Nautilus))
LuminousUpdate := Luminous
LuminousUpdate.Minor = 33
LuminousUpdate.Extra = 4
assert.True(t, LuminousUpdate.isRelease(Luminous))
MimicUpdate := Mimic
MimicUpdate.Minor = 33
MimicUpdate.Extra = 4
......@@ -130,31 +119,18 @@ func TestIsRelease(t *testing.T) {
}
func TestIsReleaseX(t *testing.T) {
assert.True(t, Luminous.IsLuminous())
assert.False(t, Mimic.IsLuminous())
assert.False(t, Nautilus.IsLuminous())
assert.False(t, Octopus.IsLuminous())
assert.False(t, Luminous.IsMimic())
assert.True(t, Mimic.IsMimic())
assert.False(t, Nautilus.IsMimic())
assert.False(t, Octopus.IsMimic())
}
func TestVersionAtLeast(t *testing.T) {
assert.True(t, Luminous.IsAtLeast(Luminous))
assert.False(t, Luminous.IsAtLeast(Mimic))
assert.False(t, Luminous.IsAtLeast(Nautilus))
assert.False(t, Luminous.IsAtLeast(Octopus))
assert.True(t, Mimic.IsAtLeast(Luminous))
assert.True(t, Mimic.IsAtLeast(Mimic))
assert.False(t, Mimic.IsAtLeast(Nautilus))
assert.False(t, Mimic.IsAtLeast(Octopus))
assert.True(t, Nautilus.IsAtLeast(Luminous))
assert.True(t, Nautilus.IsAtLeast(Mimic))
assert.True(t, Nautilus.IsAtLeast(Nautilus))
assert.False(t, Nautilus.IsAtLeast(Octopus))
assert.True(t, Octopus.IsAtLeast(Luminous))
assert.True(t, Octopus.IsAtLeast(Mimic))
assert.True(t, Octopus.IsAtLeast(Nautilus))
assert.True(t, Octopus.IsAtLeast(Octopus))
......@@ -175,8 +151,6 @@ func TestVersionAtLeastX(t *testing.T) {
assert.True(t, Nautilus.IsAtLeastNautilus())
assert.True(t, Nautilus.IsAtLeastMimic())
assert.True(t, Mimic.IsAtLeastMimic())
assert.False(t, Luminous.IsAtLeastMimic())
assert.False(t, Luminous.IsAtLeastNautilus())
assert.False(t, Mimic.IsAtLeastNautilus())
assert.False(t, Nautilus.IsAtLeastOctopus())
}
......
......@@ -38,8 +38,6 @@ import (
)
const (
// test with the latest luminous build
luminousTestImage = "ceph/ceph:v12"
// test with the latest mimic build
mimicTestImage = "ceph/ceph:v13"
// test with the latest nautilus build
......@@ -49,7 +47,6 @@ const (
)
var (
LuminousVersion = cephv1.CephVersionSpec{Image: luminousTestImage}
MimicVersion = cephv1.CephVersionSpec{Image: mimicTestImage}
NautilusVersion = cephv1.CephVersionSpec{Image: nautilusTestImage}
)
......@@ -182,7 +179,7 @@ func (h *CephInstaller) CreateK8sRookCluster(namespace, systemNamespace string,
return h.CreateK8sRookClusterWithHostPathAndDevices(namespace, systemNamespace, storeType, false,
cephv1.MonSpec{Count: 3, AllowMultiplePerNode: true}, true, /* startWithAllNodes */
1, /* rbd workers */
LuminousVersion)
NautilusVersion)
}
// CreateK8sRookCluster creates rook cluster via kubectl
......
......@@ -94,9 +94,6 @@ spec:
type: boolean
image:
type: string
name:
pattern: ^(luminous|mimic|nautilus)$
type: string
dashboard:
properties:
enabled:
......
......@@ -208,13 +208,11 @@ func setupBlockLite(helper *clients.TestClient, k8sh *utils.K8sHelper, s suite.S
// Make sure new block is created
b, err := helper.BlockClient.List(clusterNamespace)
if version != installer.LuminousVersion {
assert.Nil(s.T(), err)
assert.Equal(s.T(), initBlockCount+1, len(b), "Make sure new block image is created")
poolExists, err := helper.PoolClient.CephPoolExists(clusterNamespace, poolName)
assert.Nil(s.T(), err)
assert.True(s.T(), poolExists)
}
assert.Nil(s.T(), err)
assert.Equal(s.T(), initBlockCount+1, len(b), "Make sure new block image is created")
poolExists, err := helper.PoolClient.CephPoolExists(clusterNamespace, poolName)
assert.Nil(s.T(), err)
assert.True(s.T(), poolExists)
return initBlockCount
}
......
......@@ -60,7 +60,7 @@ func (s *BlockCreateSuite) SetupSuite() {
s.namespace = "block-k8s-ns"
mons := 1
rbdMirrorWorkers := 1
s.op, s.kh = StartTestCluster(s.T, s.namespace, "bluestore", false, false, mons, rbdMirrorWorkers, installer.VersionMaster, installer.MimicVersion)
s.op, s.kh = StartTestCluster(s.T, s.namespace, "bluestore", false, false, mons, rbdMirrorWorkers, installer.VersionMaster, installer.NautilusVersion)
s.testClient = clients.CreateTestClient(s.kh, s.op.installer.Manifests)
initialBlocks, err := s.testClient.BlockClient.List(s.namespace)
assert.Nil(s.T(), err)
......
......@@ -69,7 +69,7 @@ func (hs *HelmSuite) SetupSuite() {
hs.namespace = "helm-ns"
mons := 1
rbdMirrorWorkers := 1
hs.op, hs.kh = StartTestCluster(hs.T, hs.namespace, "bluestore", true, false, mons, rbdMirrorWorkers, installer.VersionMaster, installer.MimicVersion)
hs.op, hs.kh = StartTestCluster(hs.T, hs.namespace, "bluestore", true, false, mons, rbdMirrorWorkers, installer.VersionMaster, installer.NautilusVersion)
hs.helper = clients.CreateTestClient(hs.kh, hs.op.installer.Manifests)
}
......
......@@ -137,7 +137,7 @@ func NewMCTestOperations(t func() *testing.T, namespace1 string, namespace2 stri
kh, err := utils.CreateK8sHelper(t)
require.NoError(t(), err)
i := installer.NewCephInstaller(t, kh.Clientset, false, installer.VersionMaster, installer.LuminousVersion)
i := installer.NewCephInstaller(t, kh.Clientset, false, installer.VersionMaster, installer.NautilusVersion)
op := &MCTestOperations{i, kh, t, namespace1, namespace2, installer.SystemNamespace(namespace1)}
op.Setup()
......
......@@ -92,7 +92,7 @@ func (s *BlockMountUnMountSuite) SetupSuite() {
useDevices := true
mons := 1
rbdMirrorWorkers := 1
s.op, s.kh = StartTestCluster(s.T, s.namespace, "filestore", useHelm, useDevices, mons, rbdMirrorWorkers, installer.VersionMaster, installer.LuminousVersion)
s.op, s.kh = StartTestCluster(s.T, s.namespace, "filestore", useHelm, useDevices, mons, rbdMirrorWorkers, installer.VersionMaster, installer.NautilusVersion)
s.testClient = clients.CreateTestClient(s.kh, s.op.installer.Manifests)
s.bc = s.testClient.BlockClient
}
......
......@@ -145,7 +145,7 @@ func StartLoadTestCluster(t func() *testing.T, namespace string) (LoadTestCluste
kh, err := utils.CreateK8sHelper(t)
require.NoError(t(), err)
i := installer.NewCephInstaller(t, kh.Clientset, false, installer.VersionMaster, cephv1.CephVersionSpec{Image: "ceph/ceph:v12.2.7"})
i := installer.NewCephInstaller(t, kh.Clientset, false, installer.VersionMaster, cephv1.CephVersionSpec{Image: "ceph/ceph:v14.2.2-20190722"})
op := LoadTestCluster{i, kh, nil, t, namespace}
op.Setup()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment