* [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
* [pve-devel] applied: [PATCH manager] ui: ceph: add more compatibilty code for versions
2021-11-12 16:01 [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions Dominik Csapak
@ 2021-11-12 16:03 ` Thomas Lamprecht
2021-11-12 16:06 ` [pve-devel] " Thomas Lamprecht
2021-11-12 16:09 ` Dominik Csapak
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2021-11-12 16:03 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 12.11.21 17:01, Dominik Csapak wrote:
> 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(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions
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 ` Thomas Lamprecht
2021-11-12 16:09 ` Dominik Csapak
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2021-11-12 16:06 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 12.11.21 17:01, Dominik Csapak wrote:
> 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] || "";
[./ceph/Services.js]:
ERR : line 187 col 91: null - Parsing error: Unexpected token ;
iow: foo?[] vs foo?.[]
-> fixed up
> + if (PVE.Utils.compare_ceph_versions(host_version, maxversion) === 0) {
> if (result.health > healthstates.HEALTH_OLD) {
> result.health = healthstates.HEALTH_OLD;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions
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
2 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2021-11-12 16:09 UTC (permalink / raw)
To: pve-devel
disregard... i sent too soon...
^ 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