From 04d0cb143ef52e561dad5b95e81af1a051f193f9 Mon Sep 17 00:00:00 2001 From: kwood <155027796+qkewq@users.noreply.github.com> Date: Sat, 25 Jul 2026 17:10:45 -0700 Subject: [PATCH] Skip router configuration if no agent is present --- internal/proxmox/networking.go | 12 ++++++++++++ internal/proxmox/types.go | 1 + 2 files changed, 13 insertions(+) diff --git a/internal/proxmox/networking.go b/internal/proxmox/networking.go index b0a6ef6..9e3d3bf 100644 --- a/internal/proxmox/networking.go +++ b/internal/proxmox/networking.go @@ -127,6 +127,18 @@ func (s *ProxmoxService) ConfigurePodRouter(podNumber int, node string, vmid int WANIPBase: s.Config.WANIPBase, } + // Skip if no agent is configured on the router + vmconfig, err := s.getVMConfig(node, vmid) + if err != nil{ + return fmt.Errorf("failed to detect router agent: %v", err) + } + if vmconfig.Agent == ""{ + log.Printf("No agent detected for VM %d, skipping config", vmid) + return nil + } + + log.Printf("Detected router agent for VM %d", vmid) + // Wait for router agent to be pingable statusReq := tools.ProxmoxAPIRequest{ Method: "POST", diff --git a/internal/proxmox/types.go b/internal/proxmox/types.go index 3cef3ff..cdfa6b2 100644 --- a/internal/proxmox/types.go +++ b/internal/proxmox/types.go @@ -115,6 +115,7 @@ type VirtualResourceConfig struct { Lock string `json:"lock"` Net0 string `json:"net0"` Net1 string `json:"net1,omitempty"` + Agent string `json:"agent"` } type VirtualResourceStatus struct {