fix: ensure cluster endpoints include port number (addresses #428)

When detecting Proxmox cluster nodes, the Host field was being set to just the node name without a port. This caused validation to fail with "invalid Port number" error when qdevices were running.

Now cluster endpoints properly include the port (8006) in the Host field, allowing clusters with qdevices to be added successfully.
This commit is contained in:
Pulse Monitor
2025-09-10 17:01:11 +00:00
parent 27388e3538
commit 4ac4bb7e59
+12 -1
View File
@@ -289,10 +289,21 @@ func detectPVECluster(clientConfig proxmox.ClientConfig, nodeName string) (isClu
continue
}
// Build the host URL with proper port
// Prefer IP if available, otherwise use node name
nodeHost := clusterNode.IP
if nodeHost == "" {
nodeHost = clusterNode.Name
}
// Ensure host has port (PVE uses 8006)
if !strings.Contains(nodeHost, ":") {
nodeHost = nodeHost + ":8006"
}
endpoint := config.ClusterEndpoint{
NodeID: clusterNode.ID,
NodeName: clusterNode.Name,
Host: clusterNode.Name,
Host: nodeHost,
Online: clusterNode.Online == 1,
LastSeen: time.Now(),
}