public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Max Carrara <m.carrara@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Lukas Wagner <l.wagner@proxmox.com>
Subject: [pve-devel] [PATCH v2 pve-manager 10/10] api: ceph: change version format in OSD metadata endpoint
Date: Mon,  1 Jul 2024 16:10:40 +0200	[thread overview]
Message-ID: <20240701141040.643701-11-m.carrara@proxmox.com> (raw)
In-Reply-To: <20240701141040.643701-1-m.carrara@proxmox.com>

.. in order to include Ceph's build commit. Instead of e.g.

  18.2.2 (reef)

the string will now contain:

  18.2.2 (e9fe820e7) reef

This format is used in the OSD detail view; the build commit will
therefore also be shown there.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
---
Changes v1 --> v2:
  * NEW

NOTE: I'm not sure if this is 100% fine to do here; if it's something
that we consider to be API-breaking, I'll send in a v3 that adds the
build commit as a separate field.

 PVE/API2/Ceph/OSD.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index de4cc72b..a375bf6e 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -747,6 +747,12 @@ __PACKAGE__->register_method ({
 	my $osd_pss_memory = eval { get_proc_pss_from_pid($pid) } // 0;
 	warn $@ if $@;
 
+	my ($ceph_version, $ceph_buildcommit) = PVE::Ceph::Tools::parse_ceph_version(
+	    $metadata->{ceph_version}
+	);
+
+	$ceph_buildcommit = substr($ceph_buildcommit, 0, 9);
+
 	my $data = {
 	    osd => {
 		hostname => $metadata->{hostname},
@@ -755,7 +761,7 @@ __PACKAGE__->register_method ({
 		osd_data => $metadata->{osd_data},
 		osd_objectstore => $metadata->{osd_objectstore},
 		pid => $pid,
-		version => "$metadata->{ceph_version_short} ($metadata->{ceph_release})",
+		version => "$ceph_version ($ceph_buildcommit) $metadata->{ceph_release}",
 		front_addr => $metadata->{front_addr},
 		back_addr => $metadata->{back_addr},
 		hb_front_addr => $metadata->{hb_front_addr},
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2024-07-01 14:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 14:10 [pve-devel] [PATCH v2 pve-manager 00/10] Ceph Build Commit in UI Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 01/10] ceph: tools: refactor installation check as guard clause Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 02/10] ceph: tools: parse Ceph version in separate sub and update regex Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 03/10] ceph: services: remove old cluster broadcast Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 04/10] ceph: services: refactor version existence check as guard clause Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 05/10] utils: align regex of parse_ceph_version with Perl equivalent Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 06/10] ui: ceph: services: parse and display build commit Max Carrara
2024-07-22 15:38   ` Thomas Lamprecht
2024-07-23  6:49     ` Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 07/10] api: ceph: add build commit of host to Ceph osd index endpoint data Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 08/10] ui: ceph: osd: rework rendering of version field & show build commit Max Carrara
2024-07-01 14:10 ` [pve-devel] [PATCH v2 pve-manager 09/10] ui: ceph: osd: increase width of version column Max Carrara
2024-07-01 14:10 ` Max Carrara [this message]
2024-07-02 14:17 ` [pve-devel] [PATCH v2 pve-manager 00/10] Ceph Build Commit in UI Max Carrara
2024-07-19 12:17 ` Igor Moritz Thaller
2024-07-22  5:29   ` Max Carrara
2024-07-22 15:40 ` [pve-devel] partially-applied-series: " Thomas Lamprecht

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=20240701141040.643701-11-m.carrara@proxmox.com \
    --to=m.carrara@proxmox.com \
    --cc=l.wagner@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 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