Skip to content

Commit 81e4d03

Browse files
authored
fix: add missing verb for pods/exec (#3166)
1 parent 212a5e8 commit 81e4d03

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

platform/backend/src/websocket.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,21 @@ class WebSocketService {
508508
stdin.destroy();
509509
stdout.destroy();
510510
stderr.destroy();
511+
512+
let errorMsg = "Failed to exec into pod";
513+
if (error instanceof Error) {
514+
errorMsg = error.message;
515+
} else if (
516+
typeof error === "object" &&
517+
error !== null &&
518+
"message" in error
519+
) {
520+
errorMsg = String((error as { message: unknown }).message);
521+
}
522+
511523
this.sendToClient(ws, {
512524
type: "mcp_exec_error",
513-
payload: {
514-
serverId,
515-
error:
516-
error instanceof Error ? error.message : "Failed to exec into pod",
517-
},
525+
payload: { serverId, error: errorMsg },
518526
});
519527
}
520528
}

platform/frontend/src/app/mcp/registry/_parts/mcp-exec-terminal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function McpExecTerminal({ serverId, isActive }: McpExecTerminalProps) {
109109

110110
// Send initial resize
111111
const dims = fitAddon.proposeDimensions();
112-
if (dims) {
112+
if (dims?.cols != null && dims?.rows != null) {
113113
websocketService.send({
114114
type: "mcp_exec_resize",
115115
payload: { serverId, cols: dims.cols, rows: dims.rows },
@@ -163,7 +163,7 @@ export function McpExecTerminal({ serverId, isActive }: McpExecTerminalProps) {
163163
try {
164164
fitAddon.fit();
165165
const dims = fitAddon.proposeDimensions();
166-
if (dims) {
166+
if (dims?.cols != null && dims?.rows != null) {
167167
websocketService.send({
168168
type: "mcp_exec_resize",
169169
payload: { serverId, cols: dims.cols, rows: dims.rows },

platform/helm/archestra/templates/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rules:
3030
verbs: ["get", "list", "create", "update", "patch", "delete", "watch"]
3131
- apiGroups: [""]
3232
resources: ["pods/exec"]
33-
verbs: ["create"]
33+
verbs: ["get", "create"]
3434
- apiGroups: [""]
3535
resources: ["pods/log"]
3636
verbs: ["get", "list"]

platform/helm/archestra/tests/archestra_platform_service_account_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ tests:
9797
content:
9898
apiGroups: [""]
9999
resources: ["pods/exec"]
100-
verbs: ["create"]
100+
verbs: ["get", "create"]
101101

102102
- it: should have pod/log permissions in Role
103103
documentIndex: 1

0 commit comments

Comments
 (0)