pveceph: factor out supported/default ceph version to single source

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-06-21 17:04:02 +02:00
parent ef25743f04
commit 983921b9a1

View File

@ -106,6 +106,9 @@ __PACKAGE__->register_method ({
return undef; return undef;
}}); }});
my $supported_ceph_versions = ['octopus', 'pacific', 'quincy'];
my $default_ceph_version = 'pacific';
__PACKAGE__->register_method ({ __PACKAGE__->register_method ({
name => 'install', name => 'install',
path => 'install', path => 'install',
@ -116,8 +119,8 @@ __PACKAGE__->register_method ({
properties => { properties => {
version => { version => {
type => 'string', type => 'string',
enum => ['octopus', 'pacific', 'quincy'], enum => $supported_ceph_versions,
default => 'pacific', default => $default_ceph_version,
description => "Ceph version to install.", description => "Ceph version to install.",
optional => 1, optional => 1,
}, },
@ -139,7 +142,7 @@ __PACKAGE__->register_method ({
code => sub { code => sub {
my ($param) = @_; my ($param) = @_;
my $cephver = $param->{version} || 'pacific'; # NOTE: always change default here too! my $cephver = $param->{version} || $default_ceph_version;
my $repo = $param->{'test-repository'} ? 'test' : 'main'; my $repo = $param->{'test-repository'} ? 'test' : 'main';