Skip to content

Commit 179928b

Browse files
authored
refactor: error messages in GetKubeconfig to include node ID and IP address (#967)
1 parent 3081b76 commit 179928b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/internal/deployment/kubedeployer/kubeconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func GetKubeconfigViaSSH(ctx context.Context, privateKey string, node *Node) (st
105105

106106
ip := node.MyceliumIP
107107
if ip == "" {
108-
err := fmt.Errorf("no mycelium IP address found for node %s", node.Name)
108+
err := fmt.Errorf("no mycelium IP address found for node %s (node_id: %d)", node.Name, node.NodeID)
109109
telemetry.RecordError(span, err)
110110
return "", err
111111
}
@@ -127,11 +127,11 @@ func GetKubeconfigViaSSH(ctx context.Context, privateKey string, node *Node) (st
127127
Str("node", node.Name).
128128
Msg("Failed to execute SSH command")
129129
telemetry.RecordError(span, err)
130-
return "", fmt.Errorf("failed to execute SSH command on node %s (%s): %w", node.Name, ip, err)
130+
return "", fmt.Errorf("failed to execute SSH command on node %s (node_id: %d, ip: %s): %w", node.Name, node.NodeID, ip, err)
131131
}
132132

133133
if !isValidKubeconfig(kubeconfig) {
134-
err := fmt.Errorf("invalid kubeconfig content retrieved from node %s (%s): missing required fields", node.Name, ip)
134+
err := fmt.Errorf("invalid kubeconfig content retrieved from node %s (node_id: %d, ip: %s): missing required fields", node.Name, node.NodeID, ip)
135135
telemetry.RecordError(span, err)
136136
return "", err
137137
}

0 commit comments

Comments
 (0)