]> git.proxmox.com Git - pve-manager.git/commitdiff
api: subscription update: use new module for getting available ceph releases
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Oct 2024 13:53:12 +0000 (15:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 Oct 2024 14:23:35 +0000 (16:23 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Subscription.pm

index 0ffc30c655f86d7ba54f3604c8b753e1fb2f44e8..9e5459e480192ba5494f824f0f3f6232b0678a0a 100644 (file)
@@ -22,6 +22,7 @@ use PVE::SafeSyslog;
 use PVE::Storage;
 use PVE::Tools;
 
+use PVE::Ceph::Releases;
 use PVE::API2Tools;
 
 use base qw(PVE::RESTHandler);
@@ -96,10 +97,9 @@ sub write_etc_subscription {
     if (!(defined($info->{key}) && defined($info->{serverid}))) {
        unlink "/etc/apt/auth.conf.d/ceph.conf" or $!{ENOENT} or die "failed to remove apt auth ceph.conf - $!";
     } else {
-       # FIXME: improve this, especially the selection of valid ceph-releases
-       # NOTE: currently we should add future ceph releases as early as possible, to ensure that
+       my $supported_ceph_releases = PVE::Ceph::Releases::get_available_ceph_release_codenames(1);
        my $ceph_auth = '';
-       for my $ceph_release ('quincy', 'reef') {
+       for my $ceph_release ($supported_ceph_releases->@*) {
            $ceph_auth .= "machine enterprise.proxmox.com/debian/ceph-${ceph_release}"
            ." login $info->{key} password $info->{serverid}\n"
        }