[pve-devel] [PATCH manager 2/2] ui: ceph: fix version handling
Dominik Csapak
d.csapak at proxmox.com
Wed Nov 10 13:15:56 CET 2021
it seems we did not prepare the gui enough for the api changes.
we have to use the node specific versions, not the global 'versions'
object.
also use PVE.Utils.compare_ceph_versions everywhere, since some versions
are strings and others are the parts of the version (e.g. ["16", "2, "6"])
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/ceph/OSD.js | 6 +++---
www/manager6/ceph/Services.js | 8 ++++----
www/manager6/ceph/StatusDetail.js | 8 ++++----
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index aea38d6c..b297d3ae 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -334,7 +334,7 @@ Ext.define('PVE.node.CephOsdTree', {
return;
}
- if (node.version !== maxversion && maxversion !== "0") {
+ if (PVE.Utils.compare_ceph_versions(node.version, maxversion) !== 0 && maxversion !== "0") {
mixedversions = true;
}
@@ -503,8 +503,8 @@ Ext.define('PVE.node.CephOsdTree', {
let icon = "";
let version = value || "";
let maxversion = vm.get('maxversion');
- if (value && value !== maxversion) {
- if (rec.data.type === 'host' || versions[rec.data.host] !== maxversion) {
+ if (value && PVE.Utils.compare_ceph_versions(value, maxversion) !== 0) {
+ if (rec.data.type === 'host' || PVE.Utils.compare_ceph_versions(versions[rec.data.host] || "", maxversion) !== 0) {
icon = PVE.Utils.get_ceph_icon_html('HEALTH_UPGRADE');
} else {
icon = PVE.Utils.get_ceph_icon_html('HEALTH_OLD');
diff --git a/www/manager6/ceph/Services.js b/www/manager6/ceph/Services.js
index 6cd75618..4fc9d0af 100644
--- a/www/manager6/ceph/Services.js
+++ b/www/manager6/ceph/Services.js
@@ -50,9 +50,9 @@ Ext.define('PVE.ceph.Services', {
// order guarantee since es2020, but browsers did so before. Note, integers would break it.
const healthmap = Object.keys(healthstates);
let maxversion = "00.0.00";
- Object.values(metadata.version || {}).forEach(function(version) {
- if (PVE.Utils.compare_ceph_versions(version, maxversion) > 0) {
- maxversion = version;
+ Object.values(metadata.node || {}).forEach(function(node) {
+ if (PVE.Utils.compare_ceph_versions(node?.version?.parts, maxversion) > 0) {
+ maxversion = node?.version?.parts;
}
});
var quorummap = status && status.quorum_names ? status.quorum_names : [];
@@ -183,7 +183,7 @@ Ext.define('PVE.ceph.Services', {
if (result.version) {
result.statuses.push(gettext('Version') + ": " + result.version);
- if (result.version !== maxversion) {
+ if (PVE.Utils.compare_ceph_versions(result.version, maxversion) !== 0) {
if (metadata.version[host] === maxversion) {
if (result.health > healthstates.HEALTH_OLD) {
result.health = healthstates.HEALTH_OLD;
diff --git a/www/manager6/ceph/StatusDetail.js b/www/manager6/ceph/StatusDetail.js
index 1ca185f6..dbc55afe 100644
--- a/www/manager6/ceph/StatusDetail.js
+++ b/www/manager6/ceph/StatusDetail.js
@@ -192,9 +192,9 @@ Ext.define('PVE.ceph.StatusDetail', {
me.suspendLayout = true;
let maxversion = "0";
- Object.values(metadata.version || {}).forEach(function(version) {
- if (PVE.Utils.compare_ceph_versions(version, maxversion) > 0) {
- maxversion = version;
+ Object.values(metadata.node || {}).forEach(function(node) {
+ if (PVE.Utils.compare_ceph_versions(node?.version?.parts, maxversion) > 0) {
+ maxversion = node?.version?.parts;
}
});
@@ -203,7 +203,7 @@ Ext.define('PVE.ceph.StatusDetail', {
if (metadata.osd) {
metadata.osd.forEach(function(osd) {
let version = PVE.Utils.parse_ceph_version(osd);
- if (version !== maxversion) {
+ if (PVE.Utils.compare_ceph_versions(version, maxversion) !== 0) {
oldosds.push({
id: osd.id,
version: version,
--
2.30.2
More information about the pve-devel
mailing list