]> git.proxmox.com Git - pve-manager.git/commitdiff
pveceph: prompt user on TTY about installing experimental version
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 Oct 2024 13:57:51 +0000 (15:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 Oct 2024 14:23:35 +0000 (16:23 +0200)
Similar to how be prompt about the default installation if no
explicitly ceph version was passed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/CLI/pveceph.pm

index dba1ed82caa1f4bd3027f388175ef0a766744fdb..ec08537080a743c39e35d7f3ca692557b5cd74c2 100755 (executable)
@@ -187,8 +187,19 @@ __PACKAGE__->register_method ({
 
        PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.list", $repolist);
 
-       warn "WARNING: installing non-default ceph release '$cephver'!\n"
-           if $available_ceph_releases->{$cephver}->{unsupported};
+       if ($available_ceph_releases->{$cephver}->{unsupported}) {
+           if ($param->{'allow-experimental'}) {
+               warn "NOTE: installing experimental/tech-preview ceph release '$cephver'!\n";
+           } elsif (-t STDOUT) {
+               print "Ceph " . ucfirst($cephver) . " is currently considered experimental for Proxmox VE - continue (y/N)? ";
+               my $answer = <STDIN>;
+               my $continue = defined($answer) && $answer =~ m/^\s*y(?:es)?\s*$/i;
+
+               die "Aborting installation as requested\n" if !$continue;
+           } else {
+               die "refusing to instal experimental ceph release '$cephver' without 'allow-experimental' parameter!\n";
+           }
+       }
 
        local $ENV{DEBIAN_FRONTEND} = 'noninteractive';
        print "update available package list\n";