public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox/installer 0/2] fix auto-installer/post-hook after schema change
@ 2026-08-17 12:54 Christoph Heiss
  2026-08-17 12:54 ` [PATCH proxmox 1/2] installer-types: FqdnConfigContainer: implement AsRef into FqdnConfig Christoph Heiss
  2026-08-17 12:54 ` [PATCH installer 2/2] auto, post-hook: explicitly ref FqdnConfigContainer when `match`ing Christoph Heiss
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Heiss @ 2026-08-17 12:54 UTC (permalink / raw)
  To: pve-devel

This series adapts pve-installer to the schema change after commit

  4d7f57a12 ("installer-types: replace illegal oneOf schema")

in `proxmox`, which changed the `fqdn` field.

proxmox:

Christoph Heiss (1):
  installer-types: FqdnConfigContainer: implement AsRef into FqdnConfig

 proxmox-installer-types/src/answer.rs | 6 ++++++
 1 file changed, 6 insertions(+)

pve-installer:

Christoph Heiss (1):
  auto, post-hook: explicitly ref FqdnConfigContainer when `match`ing

 proxmox-auto-installer/src/utils.rs | 2 +-
 proxmox-post-hook/src/main.rs       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)





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

* [PATCH proxmox 1/2] installer-types: FqdnConfigContainer: implement AsRef into FqdnConfig
  2026-08-17 12:54 [PATCH proxmox/installer 0/2] fix auto-installer/post-hook after schema change Christoph Heiss
@ 2026-08-17 12:54 ` Christoph Heiss
  2026-08-17 12:54 ` [PATCH installer 2/2] auto, post-hook: explicitly ref FqdnConfigContainer when `match`ing Christoph Heiss
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Heiss @ 2026-08-17 12:54 UTC (permalink / raw)
  To: pve-devel

Zero-cost, makes handling FqdnConfigContainer (especially `match`ing on
it) simpler for consumers.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 proxmox-installer-types/src/answer.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/proxmox-installer-types/src/answer.rs b/proxmox-installer-types/src/answer.rs
index a0ca620f..e2e9b8e4 100644
--- a/proxmox-installer-types/src/answer.rs
+++ b/proxmox-installer-types/src/answer.rs
@@ -300,6 +300,12 @@ impl From<FqdnConfig> for FqdnConfigContainer {
     }
 }
 
+impl AsRef<FqdnConfig> for FqdnConfigContainer {
+    fn as_ref(&self) -> &FqdnConfig {
+        &self.fqdn
+    }
+}
+
 impl From<FqdnConfigContainer> for FqdnConfig {
     fn from(fqdn: FqdnConfigContainer) -> Self {
         fqdn.fqdn
-- 
2.55.0





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

* [PATCH installer 2/2] auto, post-hook: explicitly ref FqdnConfigContainer when `match`ing
  2026-08-17 12:54 [PATCH proxmox/installer 0/2] fix auto-installer/post-hook after schema change Christoph Heiss
  2026-08-17 12:54 ` [PATCH proxmox 1/2] installer-types: FqdnConfigContainer: implement AsRef into FqdnConfig Christoph Heiss
@ 2026-08-17 12:54 ` Christoph Heiss
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Heiss @ 2026-08-17 12:54 UTC (permalink / raw)
  To: pve-devel

Adaps both crates/binaries to the schema change after commit

  4d7f57a12 ("installer-types: replace illegal oneOf schema")

in `proxmox`, which changed the `fqdn` field.

FqdnConfigContainer now implements AsRef<FqdnConfig>, so switch to that.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Depends on the previous patch and needs an appropriate bump of the
proxmox-installer-types crate dependency.

 proxmox-auto-installer/src/utils.rs | 2 +-
 proxmox-post-hook/src/main.rs       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs
index 710af21..7205ae3 100644
--- a/proxmox-auto-installer/src/utils.rs
+++ b/proxmox-auto-installer/src/utils.rs
@@ -40,7 +40,7 @@ fn get_network_settings(
         .interface_name_pinning()
         .map(|answer| answer.into());
 
-    let mut network_options = match &answer.global.fqdn {
+    let mut network_options = match answer.global.fqdn.as_ref() {
         // If the user set a static FQDN in the answer file, override it
         FqdnConfig::Simple(name) => {
             let mut opts = NetworkOptions::defaults_from(
diff --git a/proxmox-post-hook/src/main.rs b/proxmox-post-hook/src/main.rs
index ec9ab74..749fd0e 100644
--- a/proxmox-post-hook/src/main.rs
+++ b/proxmox-post-hook/src/main.rs
@@ -98,7 +98,7 @@ mod detail {
                 .and_then(|r| Ok(String::from_utf8(r.stdout)?))
         };
 
-        let fqdn = match &answer.global.fqdn {
+        let fqdn = match answer.global.fqdn.as_ref() {
             FqdnConfig::Simple(name) => name.to_string(),
             FqdnConfig::FromDhcp(FqdnFromDhcpConfig {
                 source: FqdnSourceMode::FromDhcp,
-- 
2.55.0





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

end of thread, other threads:[~2026-08-17 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17 12:54 [PATCH proxmox/installer 0/2] fix auto-installer/post-hook after schema change Christoph Heiss
2026-08-17 12:54 ` [PATCH proxmox 1/2] installer-types: FqdnConfigContainer: implement AsRef into FqdnConfig Christoph Heiss
2026-08-17 12:54 ` [PATCH installer 2/2] auto, post-hook: explicitly ref FqdnConfigContainer when `match`ing Christoph Heiss

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