all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-perl-rs 1/3] pve-rs: fabrics: list nodes of all fabrics
Date: Fri, 20 Nov 2026 16:22:44 +0100	[thread overview]
Message-ID: <20261120152251.265831-2-g.goller@proxmox.com> (raw)
In-Reply-To: <20261120152251.265831-1-g.goller@proxmox.com>

The nodes of a host that is part of multiple fabrics overwrote each
other, so GET /cluster/sdn/fabrics/node only returned the node of the
fabric that sorts last for each host. Among others, the node edit
window lost the WireGuard interfaces offered for OSPF and BGP fabrics.

Fixes: 1c5f6859ad36 ("pve-rs: sdn: fabrics: add api methods")
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 pve-rs/src/bindings/sdn/fabrics.rs | 41 ++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs
index 98c132dd7f28..caa637ac3047 100644
--- a/pve-rs/src/bindings/sdn/fabrics.rs
+++ b/pve-rs/src/bindings/sdn/fabrics.rs
@@ -232,7 +232,7 @@ pub mod pve_rs_sdn_fabrics {
             .flat_map(|entry| {
                 entry
                     .nodes()
-                    .map(|(id, node)| (id.to_string(), node.clone().into()))
+                    .map(|(_node_id, node)| (node.id().to_string(), node.clone().into()))
             })
             .collect())
     }
@@ -1221,7 +1221,11 @@ pub mod pve_rs_sdn_fabrics {
 
     #[cfg(test)]
     mod tests {
-        use super::parse_routes;
+        use std::sync::Mutex;
+
+        use proxmox_ve_config::sdn::fabric::FabricConfig;
+
+        use super::{PerlFabricConfig, parse_routes};
 
         #[test]
         fn parses_batched_routes_with_duplicate_prefixes() {
@@ -1238,6 +1242,39 @@ pub mod pve_rs_sdn_fabrics {
             assert_eq!(routes[1].vrf_name, "vrf_b");
         }
 
+        #[test]
+        fn list_nodes_returns_host_of_every_fabric() {
+            let raw = "
+wireguard_fabric: test
+
+wireguard_node: test_node1
+\tinterfaces name=wg0,listen_port=51820,public_key=rsS0GeYRbguBG1DAzc+xxQqPDvouxlKtc+c1PPEM92I=
+\trole internal
+
+ospf_fabric: underlay
+\tarea 0
+\tip_prefix 10.0.0.0/24
+
+ospf_node: underlay_node1
+\tinterfaces name=nic1
+\tip 10.0.0.1
+";
+            let config = PerlFabricConfig {
+                fabric_config: Mutex::new(
+                    FabricConfig::parse_section_config(raw)
+                        .expect("config should parse")
+                        .into_inner(),
+                ),
+            };
+
+            let nodes = super::list_nodes(&config).expect("nodes should be listed");
+
+            assert_eq!(
+                nodes.keys().collect::<Vec<_>>(),
+                ["test_node1", "underlay_node1"],
+            );
+        }
+
         #[test]
         fn parses_empty_output() {
             let routes = parse_routes(b"", "BGP").expect("empty output should parse");
-- 
2.47.3





  reply	other threads:[~2026-11-20 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:22 [PATCH network/proxmox-perl-rs 0/3] Fix listing fabric nodes of hosts in multiple fabrics Gabriel Goller
2026-11-20 15:22 ` Gabriel Goller [this message]
2026-11-20 15:22 ` [PATCH pve-network 2/3] api: fabrics: check node permissions with the node name in list_all Gabriel Goller
2026-11-20 15:22 ` [PATCH pve-network 3/3] api: fabrics: check node permissions with the node name in list_nodes Gabriel Goller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120152251.265831-2-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal