mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-25 21:16:35 +00:00
ui: ceph: make version handling actually future proof
It seems we did not prepare the GUI enough for the API changes planned when stopping to broadcast the old single string version. We have to use the node specific versions, not the global 'versions' object. Also use the `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@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d3eed3b4a8
commit
d6fb92d747
@ -334,7 +334,7 @@ Ext.define('PVE.node.CephOsdTree', {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.version !== maxversion && maxversion !== "0") {
|
if (PVE.Utils.compare_ceph_versions(node.version, maxversion) !== 0 && maxversion !== "0") {
|
||||||
mixedversions = true;
|
mixedversions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,8 +503,8 @@ Ext.define('PVE.node.CephOsdTree', {
|
|||||||
let icon = "";
|
let icon = "";
|
||||||
let version = value || "";
|
let version = value || "";
|
||||||
let maxversion = vm.get('maxversion');
|
let maxversion = vm.get('maxversion');
|
||||||
if (value && value !== maxversion) {
|
if (value && PVE.Utils.compare_ceph_versions(value, maxversion) !== 0) {
|
||||||
if (rec.data.type === 'host' || versions[rec.data.host] !== maxversion) {
|
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');
|
icon = PVE.Utils.get_ceph_icon_html('HEALTH_UPGRADE');
|
||||||
} else {
|
} else {
|
||||||
icon = PVE.Utils.get_ceph_icon_html('HEALTH_OLD');
|
icon = PVE.Utils.get_ceph_icon_html('HEALTH_OLD');
|
||||||
|
@ -50,9 +50,9 @@ Ext.define('PVE.ceph.Services', {
|
|||||||
// order guarantee since es2020, but browsers did so before. Note, integers would break it.
|
// order guarantee since es2020, but browsers did so before. Note, integers would break it.
|
||||||
const healthmap = Object.keys(healthstates);
|
const healthmap = Object.keys(healthstates);
|
||||||
let maxversion = "00.0.00";
|
let maxversion = "00.0.00";
|
||||||
Object.values(metadata.version || {}).forEach(function(version) {
|
Object.values(metadata.node || {}).forEach(function(node) {
|
||||||
if (PVE.Utils.compare_ceph_versions(version, maxversion) > 0) {
|
if (PVE.Utils.compare_ceph_versions(node?.version?.parts, maxversion) > 0) {
|
||||||
maxversion = version;
|
maxversion = node?.version?.parts;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var quorummap = status && status.quorum_names ? status.quorum_names : [];
|
var quorummap = status && status.quorum_names ? status.quorum_names : [];
|
||||||
@ -183,7 +183,7 @@ Ext.define('PVE.ceph.Services', {
|
|||||||
if (result.version) {
|
if (result.version) {
|
||||||
result.statuses.push(gettext('Version') + ": " + 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 (metadata.version[host] === maxversion) {
|
||||||
if (result.health > healthstates.HEALTH_OLD) {
|
if (result.health > healthstates.HEALTH_OLD) {
|
||||||
result.health = healthstates.HEALTH_OLD;
|
result.health = healthstates.HEALTH_OLD;
|
||||||
|
@ -192,9 +192,9 @@ Ext.define('PVE.ceph.StatusDetail', {
|
|||||||
me.suspendLayout = true;
|
me.suspendLayout = true;
|
||||||
|
|
||||||
let maxversion = "0";
|
let maxversion = "0";
|
||||||
Object.values(metadata.version || {}).forEach(function(version) {
|
Object.values(metadata.node || {}).forEach(function(node) {
|
||||||
if (PVE.Utils.compare_ceph_versions(version, maxversion) > 0) {
|
if (PVE.Utils.compare_ceph_versions(node?.version?.parts, maxversion) > 0) {
|
||||||
maxversion = version;
|
maxversion = node?.version?.parts;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ Ext.define('PVE.ceph.StatusDetail', {
|
|||||||
if (metadata.osd) {
|
if (metadata.osd) {
|
||||||
metadata.osd.forEach(function(osd) {
|
metadata.osd.forEach(function(osd) {
|
||||||
let version = PVE.Utils.parse_ceph_version(osd);
|
let version = PVE.Utils.parse_ceph_version(osd);
|
||||||
if (version !== maxversion) {
|
if (PVE.Utils.compare_ceph_versions(version, maxversion) !== 0) {
|
||||||
oldosds.push({
|
oldosds.push({
|
||||||
id: osd.id,
|
id: osd.id,
|
||||||
version: version,
|
version: version,
|
||||||
|
Loading…
Reference in New Issue
Block a user