public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions
@ 2021-11-12 16:01 Dominik Csapak
  2021-11-12 16:03 ` [pve-devel] applied: " Thomas Lamprecht
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dominik Csapak @ 2021-11-12 16:01 UTC (permalink / raw)
  To: pve-devel

we now have to handle the version of 'old' nodes, as well as the
new nodes, which are missing the 'version' field in the metadata/osd call

so set the 'versions' object to a default empty object for osds
and get the host version directly from the treenode
(the parent node of the osd node)

also compare the host version in the dashboard by getting first the
new version field, and the old one as fallback.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/ceph/OSD.js      | 5 +++--
 www/manager6/ceph/Services.js | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index b2120956..9e737852 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -316,7 +316,7 @@ Ext.define('PVE.node.CephOsdTree', {
 		    if (selected.length) {
 			name = selected[0].data.name;
 		    }
-		    vm.set('versions', data.versions);
+		    vm.set('versions', data.versions || {});
 		    // extract max version
 		    let maxversion = "0";
 		    let mixedversions = false;
@@ -507,7 +507,8 @@ Ext.define('PVE.node.CephOsdTree', {
 	    let version = value || "";
 	    let maxversion = vm.get('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) {
+		let host_version = rec.parentNode?.data?.version || versions[rec.data.host] || "";
+		if (rec.data.type === 'host' || PVE.Utils.compare_ceph_versions(host_version, 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 4fc9d0af..77ade27b 100644
--- a/www/manager6/ceph/Services.js
+++ b/www/manager6/ceph/Services.js
@@ -184,7 +184,8 @@ Ext.define('PVE.ceph.Services', {
 		    result.statuses.push(gettext('Version') + ": " + result.version);
 
 		    if (PVE.Utils.compare_ceph_versions(result.version, maxversion) !== 0) {
-			if (metadata.version[host] === maxversion) {
+			let host_version = metadata.node[host]?.version?.parts || metadata.version?[host] || "";
+			if (PVE.Utils.compare_ceph_versions(host_version, maxversion) === 0) {
 			    if (result.health > healthstates.HEALTH_OLD) {
 				result.health = healthstates.HEALTH_OLD;
 			    }
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-12 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 16:01 [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions Dominik Csapak
2021-11-12 16:03 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-12 16:06 ` [pve-devel] " Thomas Lamprecht
2021-11-12 16:09 ` Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal