Merge pull request #6932 from leseb/pacific-support

ceph: add pacific release name support and do no turn on the balancer since it is only on
This commit is contained in:
Travis Nielsen authored and GitHub committed 2021-01-08 16:44:14 -07:00
commit b4ae718cdb
3 files changed
+18 -3

No files matched your search

+7 -1
View File
@@ -34,7 +34,13 @@ func MgrEnableModule(context *clusterd.Context, clusterInfo *ClusterInfo, name s
retryCount := 5
var err error
for i := 0; i < retryCount; i++ {
if name == "balancer" {
/* In Pacific the balancer is now on by default in upmap mode.
In earlier versions, the balancer was included in the ``always_on_modules`` list, but needed to be
turned on explicitly using the ``ceph balancer on`` command. */
if name == "balancer" && clusterInfo.CephVersion.IsAtLeastPacific() {
logger.Debug("balancer module is already 'on' on pacific, doing nothing", name)
return nil
} else if name == "balancer" {
err = enableDisableBalancerModule(context, clusterInfo, "on")
} else {
err = enableModule(context, clusterInfo, name, force, "enable")
+7
View File
@@ -21,6 +21,7 @@ import (
"github.com/pkg/errors"
"github.com/rook/rook/pkg/clusterd"
"github.com/rook/rook/pkg/operator/ceph/version"
exectest "github.com/rook/rook/pkg/util/exec/test"
"github.com/stretchr/testify/assert"
)
@@ -59,10 +60,16 @@ func TestEnableModuleRetries(t *testing.T) {
_ = MgrEnableModule(&clusterd.Context{Executor: executor}, clusterInfo, "pg_autoscaler", false)
assert.Equal(t, 0, moduleEnableRetries)
// Balancer not on Ceph Pacific
moduleEnableRetries = 0
_ = MgrEnableModule(&clusterd.Context{Executor: executor}, clusterInfo, "balancer", false)
assert.Equal(t, 0, moduleEnableRetries)
// Balancer skipped on Pacific
clusterInfo.CephVersion = version.Pacific
_ = MgrEnableModule(&clusterd.Context{Executor: executor}, clusterInfo, "balancer", false)
assert.Equal(t, 0, moduleEnableRetries)
}
func TestEnableModule(t *testing.T) {
+4 -2
View File
@@ -80,10 +80,12 @@ func (v *CephVersion) CephVersionFormatted() string {
// ReleaseName is the name of the Ceph release
func (v *CephVersion) ReleaseName() string {
switch v.Major {
case Octopus.Major:
return "octopus"
case Nautilus.Major:
return "nautilus"
case Octopus.Major:
return "octopus"
case Pacific.Major:
return "pacific"
default:
return unknownVersionString
}