From ec880798ba7aa28ded5eb83c860c5f913caf9702 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Mon, 22 Apr 2024 14:46:43 +0200 Subject: [PATCH] auto-installer: use new `lvm_auto_rename` option to avoid prompt Signed-off-by: Christoph Heiss --- proxmox-auto-installer/src/utils.rs | 1 + .../tests/resources/parse_answer/disk_match.json | 1 + .../tests/resources/parse_answer/disk_match_all.json | 1 + .../tests/resources/parse_answer/disk_match_any.json | 1 + .../tests/resources/parse_answer/minimal.json | 1 + .../tests/resources/parse_answer/nic_matching.json | 1 + .../tests/resources/parse_answer/specific_nic.json | 1 + proxmox-auto-installer/tests/resources/parse_answer/zfs.json | 1 + proxmox-installer-common/src/setup.rs | 2 ++ proxmox-tui-installer/src/setup.rs | 1 + 10 files changed, 11 insertions(+) diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 168e5cb..e72f906 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -378,6 +378,7 @@ pub fn parse_answer( zfs_opts: None, target_hd: None, disk_selection: BTreeMap::new(), + lvm_auto_rename: 1, country: answer.global.country.clone(), timezone: answer.global.timezone.clone(), diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json index bc19d88..837de52 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json @@ -10,6 +10,7 @@ "8": "8", "9": "9" }, + "lvm_auto_rename": 1, "filesys": "zfs (RAID10)", "gateway": "192.168.1.1", "hdsize": 223.57088470458984, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json index ce2071e..18c61c0 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json @@ -7,6 +7,7 @@ "disk_selection": { "9": "9" }, + "lvm_auto_rename": 1, "filesys": "zfs (RAID0)", "gateway": "192.168.1.1", "hdsize": 223.57088470458984, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json index ae4debe..a756946 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json @@ -14,6 +14,7 @@ "8": "8", "9": "9" }, + "lvm_auto_rename": 1, "filesys": "zfs (RAID10)", "gateway": "192.168.1.1", "hdsize": 2980.820640563965, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json index 4312ccd..8514199 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json @@ -7,6 +7,7 @@ "filesys": "ext4", "gateway": "192.168.1.1", "hdsize": 223.57088470458984, + "lvm_auto_rename": 1, "hostname": "pveauto", "keymap": "de", "mailto": "mail@no.invalid", diff --git a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json index 6d16a3a..3635b0d 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json @@ -7,6 +7,7 @@ "filesys": "ext4", "gateway": "10.10.10.1", "hdsize": 223.57088470458984, + "lvm_auto_rename": 1, "hostname": "pveauto", "keymap": "de", "mailto": "mail@no.invalid", diff --git a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json index 51ab029..b5e0de4 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json @@ -7,6 +7,7 @@ "filesys": "ext4", "gateway": "10.10.10.1", "hdsize": 223.57088470458984, + "lvm_auto_rename": 1, "hostname": "pveauto", "keymap": "de", "mailto": "mail@no.invalid", diff --git a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json index 0580482..508ad69 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json @@ -8,6 +8,7 @@ "6": "6", "7": "7" }, + "lvm_auto_rename": 1, "filesys": "zfs (RAID1)", "gateway": "192.168.1.1", "hdsize": 80.0, diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs index 7232f41..c4a92f9 100644 --- a/proxmox-installer-common/src/setup.rs +++ b/proxmox-installer-common/src/setup.rs @@ -479,6 +479,8 @@ pub struct InstallConfig { #[serde(skip_serializing_if = "BTreeMap::is_empty")] pub disk_selection: BTreeMap, + pub lvm_auto_rename: usize, + pub country: String, pub timezone: String, pub keymap: String, diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs index be8acee..5d786b7 100644 --- a/proxmox-tui-installer/src/setup.rs +++ b/proxmox-tui-installer/src/setup.rs @@ -17,6 +17,7 @@ impl From for InstallConfig { zfs_opts: None, target_hd: None, disk_selection: BTreeMap::new(), + lvm_auto_rename: 0, country: options.timezone.country, timezone: options.timezone.timezone, -- 2.39.5