Hello community,

here is the log from the commit of package rook for openSUSE:Leap:15.2 checked 
in at 2020-03-13 10:59:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/rook (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.rook.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rook"

Fri Mar 13 10:59:38 2020 rev:2 rq:784430 version:1.2.4+git9.gd747507e

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/rook/rook.changes      2020-03-09 
17:59:41.400648465 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.rook.new.3160/rook.changes    2020-03-13 
11:01:42.708620199 +0100
@@ -1,0 +2,6 @@
+Tue Mar 10 10:39:11 UTC 2020 - Kristoffer Gronlund <[email protected]>
+
+- ceph: orchestrator cli name change
+  * Add orchestrator-cli-rename.patch
+
+-------------------------------------------------------------------

New:
----
  orchestrator-cli-rename.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rook.spec ++++++
--- /var/tmp/diff_new_pack.A8PKMi/_old  2020-03-13 11:01:43.552620801 +0100
+++ /var/tmp/diff_new_pack.A8PKMi/_new  2020-03-13 11:01:43.556620804 +0100
@@ -40,6 +40,8 @@
 Patch1:         csi-template-paths.patch
 # Change the default FlexVolume dir path to support Kubic.
 Patch2:         flexvolume-dir.patch
+# Orchestrator CLI renamed from orchestrator -> orch
+Patch3:         orchestrator-cli-rename.patch
 
 %if 0%{?suse_version}
 # _insert_obs_source_lines_here
@@ -137,6 +139,7 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 # determine image names to use in manifests depending on the base os type
 # %CEPH_VERSION% is replaced at build time by the _service

++++++ orchestrator-cli-rename.patch ++++++
commit 3632e52e8f2dcfa156760dde80bd387bd2fab54c
Author: Sébastien Han <[email protected]>
Date:   Fri Mar 6 17:00:37 2020 +0100

    ceph: orchestrator cli name change
    
    With https://github.com/ceph/ceph/pull/33131, the CLI has been rename
    'orch' instead of 'orchestrator'.
    Octopus only.
    
    Signed-off-by: Sébastien Han <[email protected]>

diff --git a/pkg/operator/ceph/cluster/mgr/orchestrator.go 
b/pkg/operator/ceph/cluster/mgr/orchestrator.go
index 70420ee5..d3a606e7 100644
--- a/pkg/operator/ceph/cluster/mgr/orchestrator.go
+++ b/pkg/operator/ceph/cluster/mgr/orchestrator.go
@@ -27,10 +27,13 @@ import (
 const (
        orchestratorModuleName = "orchestrator_cli"
        rookModuleName         = "rook"
+       orchestratorOldCLIName = "orchestrator"
+       orchestratorNewCLIName = "orch"
 )
 
 var (
        orchestratorInitWaitTime = 5 * time.Second
+       orchestratorCLIName      = orchestratorOldCLIName
 )
 
 // Ceph docs about the orchestrator modules: 
http://docs.ceph.com/docs/master/mgr/orchestrator_cli/
@@ -53,13 +56,12 @@ func (c *Cluster) configureOrchestratorModules() error {
 }
 
 func (c *Cluster) setRookOrchestratorBackend() error {
-       if !c.clusterInfo.CephVersion.IsAtLeastNautilus() {
-               return nil
+       if c.clusterInfo.CephVersion.IsAtLeastOctopus() {
+               orchestratorCLIName = orchestratorNewCLIName
        }
-
        // retry a few times in the case that the mgr module is not ready to 
accept commands
        _, err := client.ExecuteCephCommandWithRetry(func() ([]byte, error) {
-               args := []string{"orchestrator", "set", "backend", "rook"}
+               args := []string{orchestratorCLIName, "set", "backend", "rook"}
                return client.NewCephCommand(c.context, c.Namespace, 
args).RunWithTimeout(client.CmdExecuteTimeout)
        }, c.exitCode, 5, invalidArgErrorCode, orchestratorInitWaitTime)
        if err != nil {
diff --git a/pkg/operator/ceph/cluster/mgr/orchestrator_test.go 
b/pkg/operator/ceph/cluster/mgr/orchestrator_test.go
index 0d6c1be2..17aa26c4 100644
--- a/pkg/operator/ceph/cluster/mgr/orchestrator_test.go
+++ b/pkg/operator/ceph/cluster/mgr/orchestrator_test.go
@@ -102,4 +102,23 @@ func TestOrchestratorModules(t *testing.T) {
        assert.True(t, orchestratorModuleEnabled)
        assert.True(t, rookModuleEnabled)
        assert.True(t, rookBackendSet)
+
+       // Simulate the error because of the CLI name change
+       c.clusterInfo.CephVersion = cephver.Octopus
+       err = c.setRookOrchestratorBackend()
+       assert.Error(t, err)
+       executor.MockExecuteCommandWithOutputFileTimeout = func(debug bool, 
timeout time.Duration, actionName, command, outputFile string, args ...string) 
(string, error) {
+               logger.Infof("Command: %s %v", command, args)
+               if args[0] == "orch" && args[1] == "set" && args[2] == 
"backend" && args[3] == "rook" {
+                       if backendErrorCount < 5 {
+                               backendErrorCount++
+                               return "", errors.New("test simulation failure")
+                       }
+                       rookBackendSet = true
+                       return "", nil
+               }
+               return "", errors.Errorf("unexpected ceph command %q", args)
+       }
+       err = c.setRookOrchestratorBackend()
+       assert.NoError(t, err)
 }

Reply via email to