From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] ui: ceph: add more compatibilty code for versions
Date: Fri, 12 Nov 2021 17:06:56 +0100 [thread overview]
Message-ID: <59d69cc9-8ff4-3c71-6f3f-d7ee4654016f@proxmox.com> (raw)
In-Reply-To: <20211112160104.506805-1-d.csapak@proxmox.com>
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;
> }
>
next prev parent reply other threads:[~2021-11-12 16:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-12 16:01 Dominik Csapak
2021-11-12 16:03 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-12 16:06 ` Thomas Lamprecht [this message]
2021-11-12 16:09 ` [pve-devel] " Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59d69cc9-8ff4-3c71-6f3f-d7ee4654016f@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.