public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH installer] assistant: error out on set network config for dhcp
@ 2024-04-23 15:18 Stoiko Ivanov
  2024-04-23 16:31 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2024-04-23 15:18 UTC (permalink / raw)
  To: pve-devel

potentially will not happen too often in practice if the sample files
always contain the right source. Still having settings in an answer
file that get ignored does not seem right.

tested with `validate-answer` on a file without `source` in the
network section (which initially caused confusion for me)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 proxmox-auto-installer/src/answer.rs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs
index de8a360..df20db3 100644
--- a/proxmox-auto-installer/src/answer.rs
+++ b/proxmox-auto-installer/src/answer.rs
@@ -87,6 +87,19 @@ impl TryFrom<NetworkInAnswer> for Network {
                 }),
             })
         } else {
+            if network.cidr.is_some() {
+                return Err("Field 'cidr' not supported for 'from-dhcp' config.");
+            }
+            if network.dns.is_some() {
+                return Err("Field 'dns' not supported for 'from-dhcp' config.");
+            }
+            if network.gateway.is_some() {
+                return Err("Field 'gateway' not supported for 'from-dhcp' config.");
+            }
+            if network.filter.is_some() {
+                return Err("Field 'filter' not supported for 'from-dhcp' config.");
+            }
+
             Ok(Network {
                 network_settings: NetworkSettings::FromDhcp,
             })
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-23 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 15:18 [pve-devel] [PATCH installer] assistant: error out on set network config for dhcp Stoiko Ivanov
2024-04-23 16:31 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal