[pve-devel] [PATCH installer 4/5] auto-installer: add redundant kebab-case renames to config structures

Daniel Kral d.kral at proxmox.com
Mon Feb 17 13:17:47 CET 2025


Those attributes are not necessary, but make it explicit that answer
file properties should use kebab-cased property names from now on and
therefore make it harder to accidentally add a non-kebab-cased property.

Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
 proxmox-auto-installer/src/answer.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs
index c834591..5191a49 100644
--- a/proxmox-auto-installer/src/answer.rs
+++ b/proxmox-auto-installer/src/answer.rs
@@ -137,7 +137,7 @@ enum NetworkConfigMode {
 }
 
 #[derive(Clone, Deserialize, Debug)]
-#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case", deny_unknown_fields)]
 struct NetworkInAnswer {
     #[serde(default)]
     pub source: NetworkConfigMode,
@@ -350,7 +350,7 @@ pub struct ZfsOptions {
 }
 
 #[derive(Clone, Copy, Default, Deserialize, Serialize, Debug)]
-#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case", deny_unknown_fields)]
 pub struct LvmOptions {
     pub hdsize: Option<f64>,
     pub swapsize: Option<f64>,
@@ -360,7 +360,7 @@ pub struct LvmOptions {
 }
 
 #[derive(Clone, Copy, Default, Deserialize, Debug)]
-#[serde(deny_unknown_fields)]
+#[serde(rename_all = "kebab-case", deny_unknown_fields)]
 pub struct BtrfsOptions {
     pub hdsize: Option<f64>,
     pub raid: Option<BtrfsRaidLevel>,
-- 
2.39.5





More information about the pve-devel mailing list