Skip to content

Commit

Permalink
Merge pull request rook#3438 from SUSE/fix-merge-bug-in-master
Browse files Browse the repository at this point in the history
Ceph: Fix crit bug in call to detect Ceph version
  • Loading branch information
BlaineEXE authored Jul 11, 2019
2 parents c2225ce + cc359b6 commit 582fe01
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/operator/ceph/cluster/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ import (
)

const (
crushConfigMapName = "rook-crush-config"
crushmapCreatedKey = "initialCrushMapCreated"
clusterCreateInterval = 6 * time.Second
clusterCreateTimeout = 60 * time.Minute
updateClusterInterval = 30 * time.Second
updateClusterTimeout = 1 * time.Hour
crushConfigMapName = "rook-crush-config"
crushmapCreatedKey = "initialCrushMapCreated"
clusterCreateInterval = 6 * time.Second
clusterCreateTimeout = 60 * time.Minute
updateClusterInterval = 30 * time.Second
updateClusterTimeout = 1 * time.Hour
detectCephVersionTimeout = 15 * time.Minute
)

const (
Expand Down Expand Up @@ -283,7 +284,7 @@ func (c *ClusterController) onAdd(obj interface{}) {
// Start the Rook cluster components. Retry several times in case of failure.
validOrchestration := true
err = wait.Poll(clusterCreateInterval, clusterCreateTimeout, func() (bool, error) {
cephVersion, err := cluster.detectCephVersion(c.rookImage, cluster.Spec.CephVersion.Image, 15*time.Minute)
cephVersion, err := cluster.detectCephVersion(c.rookImage, cluster.Spec.CephVersion.Image, detectCephVersionTimeout)
if err != nil {
logger.Errorf("unknown ceph major version. %+v", err)
return false, nil
Expand Down Expand Up @@ -496,7 +497,7 @@ func (c *ClusterController) onUpdate(oldObj, newObj interface{}) {
// if the image changed, we need to detect the new image version
if oldClust.Spec.CephVersion.Image != newClust.Spec.CephVersion.Image {
logger.Infof("the ceph version changed. detecting the new image version...")
version, err := cluster.detectCephVersion(c.rookImage, newClust.Spec.CephVersion.Image, 15*time.Minute)
version, err := cluster.detectCephVersion(c.rookImage, newClust.Spec.CephVersion.Image, detectCephVersionTimeout)
if err != nil {
logger.Errorf("unknown ceph major version. %+v", err)
return
Expand All @@ -516,7 +517,7 @@ func (c *ClusterController) onUpdate(oldObj, newObj interface{}) {
}

// Re-setting cluster version too since LoadClusterInfo does not load it
version, err := cluster.detectCephVersion(newClust.Spec.CephVersion.Image, 15*time.Minute)
version, err := cluster.detectCephVersion(c.rookImage, newClust.Spec.CephVersion.Image, detectCephVersionTimeout)
if err != nil {
logger.Errorf("unknown ceph major version. %+v", err)
return
Expand Down

0 comments on commit 582fe01

Please sign in to comment.