mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-07-25 08:29:20 +00:00
fix #5600: pbs2to3: allow arbitrary newer '-pve' kernels after upgrade
Fixes a bug where `pbs2to3` shows an incorrect warning about an unexpected running kernel version, where newer kernel versions than 6.5 were marked as unexpected (e.g. "8.6.12-1-pve"). This commit allows arbitrary newer kernel versions that are suffixed with '-pve' from kernel version 6.2 onward. This is the same behavior as in other upgrade helpers like `pve7to8` [1] and `pmg7to8` [2]. [1] https://git.proxmox.com/?p=pve-manager.git;a=commit;h=fb59038a8b110b0b0b438ec035fd41dd9d591232 [2] https://git.proxmox.com/?p=pmg-api.git;a=commit;h=9d67a9af218b73027822c9c4665b88e6662e7ef7 Signed-off-by: Daniel Kral <d.kral@proxmox.com>
This commit is contained in:
parent
65574209ad
commit
974b4527e2
@ -2,6 +2,7 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::{format_err, Error};
|
||||
use const_format::concatcp;
|
||||
use regex::Regex;
|
||||
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
|
||||
|
||||
@ -124,8 +125,11 @@ impl Checker {
|
||||
}
|
||||
|
||||
fn is_kernel_version_compatible(&self, running_version: &str) -> bool {
|
||||
const MINIMUM_RE: &str = r"6\.(?:2\.(?:[2-9]\d+|1[6-8]|1\d\d+)|5)[^~]*";
|
||||
const ARBITRARY_RE: &str = r"(?:[6-9]|\d{2,})\.(?:[2-9]|\d{2,})[^~]*-pve";
|
||||
|
||||
let re = if self.upgraded {
|
||||
r"^6\.(?:2\.(?:[2-9]\d+|1[6-8]|1\d\d+)|5)[^~]*$"
|
||||
concatcp!(r"^(?:", MINIMUM_RE, r"|", ARBITRARY_RE, r")$")
|
||||
} else {
|
||||
r"^(?:5\.(?:13|15)|6\.2)"
|
||||
};
|
||||
@ -662,7 +666,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_is_proxmox_kernel_version_compatible() {
|
||||
let expected_versions = &["6.2.16-20-pve", "6.5.13-6-pve"];
|
||||
let expected_versions = &["6.2.16-20-pve", "6.5.13-6-pve", "6.8.12-1-pve"];
|
||||
let unexpected_versions = &["5.13.19-6-pve", "6.1.15-1-pve"];
|
||||
|
||||
test_is_kernel_version_compatible(expected_versions, unexpected_versions, true);
|
||||
|
Loading…
Reference in New Issue
Block a user