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:
3 files changed
+18
-3
No files matched your search
@@ -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")
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user