ceph: failed reconcile if ceph version is not found
This is critical to get this information so that the label can be set properly and also the configuration done appropriately. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
1 parent
0e2f84f998
commit
f64500a954
4 files changed
+20
-2
No files matched your search
@@ -195,7 +195,7 @@ func (r *ReconcileCephFilesystem) reconcile(request reconcile.Request) (reconcil
|
||||
daemon := string(opconfig.MonType)
|
||||
currentCephVersion, err := cephclient.LeastUptodateDaemonVersion(r.context, r.clusterInfo.Name, daemon)
|
||||
if err != nil {
|
||||
logger.Errorf("failed to retrieve current ceph %q version. %v", daemon, err)
|
||||
return reconcile.Result{}, errors.Wrapf(err, "failed to retrieve current ceph %q version", daemon)
|
||||
}
|
||||
r.clusterInfo.CephVersion = currentCephVersion
|
||||
|
||||
|
||||
@@ -133,6 +133,12 @@ const (
|
||||
"id":1
|
||||
}`
|
||||
mdsCephAuthGetOrCreateKey = `{"key":"AQCvzWBeIV9lFRAAninzm+8XFxbSfTiPwoX50g=="}`
|
||||
dummyVersionsRaw = `
|
||||
{
|
||||
"mon": {
|
||||
"ceph version 14.2.8 (3a54b2b6d167d4a2a19e003a705696d4fe619afc) nautilus (stable)": 3
|
||||
}
|
||||
}`
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -181,6 +187,9 @@ func TestCephObjectStoreController(t *testing.T) {
|
||||
if args[0] == "auth" && args[1] == "get-or-create-key" {
|
||||
return mdsCephAuthGetOrCreateKey, nil
|
||||
}
|
||||
if args[0] == "versions" {
|
||||
return dummyVersionsRaw, nil
|
||||
}
|
||||
return "", nil
|
||||
},
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ func (r *ReconcileCephObjectStore) reconcile(request reconcile.Request) (reconci
|
||||
daemon := string(opconfig.MonType)
|
||||
currentCephVersion, err := cephclient.LeastUptodateDaemonVersion(r.context, r.clusterInfo.Name, daemon)
|
||||
if err != nil {
|
||||
logger.Errorf("failed to retrieve current ceph %q version. %v", daemon, err)
|
||||
return reconcile.Result{}, errors.Wrapf(err, "failed to retrieve current ceph %q version", daemon)
|
||||
}
|
||||
r.clusterInfo.CephVersion = currentCephVersion
|
||||
|
||||
|
||||
@@ -131,6 +131,12 @@ const (
|
||||
"realm_id": ""
|
||||
}`
|
||||
rgwCephAuthGetOrCreateKey = `{"key":"AQCvzWBeIV9lFRAAninzm+8XFxbSfTiPwoX50g=="}`
|
||||
dummyVersionsRaw = `
|
||||
{
|
||||
"mon": {
|
||||
"ceph version 14.2.8 (3a54b2b6d167d4a2a19e003a705696d4fe619afc) nautilus (stable)": 3
|
||||
}
|
||||
}`
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -173,6 +179,9 @@ func TestCephObjectStoreController(t *testing.T) {
|
||||
if args[0] == "auth" && args[1] == "get-or-create-key" {
|
||||
return rgwCephAuthGetOrCreateKey, nil
|
||||
}
|
||||
if args[0] == "versions" {
|
||||
return dummyVersionsRaw, nil
|
||||
}
|
||||
return "", nil
|
||||
},
|
||||
MockExecuteCommandWithOutput: func(command string, args ...string) (string, error) {
|
||||
|
||||
Reference in new issue
Block a user