From: Kefu Chai <k.chai@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager 5/5] ceph: drop duplicate release-to-codename map in upgrade checks
Date: Tue, 28 Apr 2026 10:45:38 +0800 [thread overview]
Message-ID: <20260428024538.3559017-6-k.chai@proxmox.com> (raw)
In-Reply-To: <20260428024538.3559017-1-k.chai@proxmox.com>
Drop the local $ceph_release2code map in PVE::Ceph::UpgradeCheck and
look up codenames through PVE::Ceph::Releases::get_codename_for_major_release()
instead. The map duplicated data already maintained in Releases.pm, so
adding a new Ceph release would have required two updates.
No functional change.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
PVE/Ceph/UpgradeCheck.pm | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/PVE/Ceph/UpgradeCheck.pm b/PVE/Ceph/UpgradeCheck.pm
index 09418df3..4103c136 100644
--- a/PVE/Ceph/UpgradeCheck.pm
+++ b/PVE/Ceph/UpgradeCheck.pm
@@ -17,20 +17,10 @@ use PVE::Ceph::Releases;
use PVE::Ceph::Tools;
use PVE::Cluster;
-my $ceph_release2code = {
- '12' => 'Luminous',
- '13' => 'Mimic',
- '14' => 'Nautilus',
- '15' => 'Octopus',
- '16' => 'Pacific',
- '17' => 'Quincy',
- '18' => 'Reef',
- '19' => 'Squid',
- '20' => 'Tentacle',
-};
my $default_supported_release = 19; # available before and after the current major upgrade
-my $default_supported_code_name = $ceph_release2code->{"$default_supported_release"}
- or die "inconsistent source code, could not map expected ceph version to code name!";
+my $default_supported_code_name =
+ ucfirst(PVE::Ceph::Releases::get_codename_for_major_release($default_supported_release)
+ // die "inconsistent source code, could not map expected ceph version to code name!\n");
sub run_checks {
my (%args) = @_;
@@ -118,13 +108,18 @@ sub check_versions {
my @out;
my $noout_wanted = 1;
- my $supported_code_name = $supported_release == $default_supported_release
+ my $supported_code_name =
+ $supported_release == $default_supported_release
? $default_supported_code_name
- : ($ceph_release2code->{"$supported_release"} // 'unknown');
+ : do {
+ my $codename = PVE::Ceph::Releases::get_codename_for_major_release($supported_release);
+ defined($codename) ? ucfirst($codename) : 'unknown';
+ };
push @out, { level => 'info', msg => "checking local Ceph version.." };
if (my $release = eval { PVE::Ceph::Tools::get_local_version(1) }) {
- my $code_name = $ceph_release2code->{"$release"} || 'unknown';
+ my $codename = PVE::Ceph::Releases::get_codename_for_major_release($release);
+ my $code_name = defined($codename) ? ucfirst($codename) : 'unknown';
if ($release == $supported_release) {
push @out,
{
--
2.47.3
prev parent reply other threads:[~2026-04-28 2:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 2:45 [PATCH manager 0/5] ceph: add 'pveceph upgrade-check' subcommand Kefu Chai
2026-04-28 2:45 ` [PATCH manager 1/5] pve8to9: extract ceph checks into PVE::Ceph::UpgradeCheck Kefu Chai
2026-04-28 2:45 ` [PATCH manager 2/5] ceph: add pveceph upgrade-check command Kefu Chai
2026-04-28 2:45 ` [PATCH manager 3/5] ceph: add require_osd_release upgrade check Kefu Chai
2026-04-28 2:45 ` [PATCH manager 4/5] ceph: add require_min_compat_client " Kefu Chai
2026-04-28 2:45 ` Kefu Chai [this message]
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=20260428024538.3559017-6-k.chai@proxmox.com \
--to=k.chai@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