fix(plugin): close timed out kubernetes exec sockets

This commit is contained in:
Dotta
2026-05-13 15:06:26 -05:00
committed by Chris Farhood
parent 1eccb71213
commit 9035b70aa9
2 changed files with 12 additions and 2 deletions
@@ -155,7 +155,15 @@ export async function execInPod(
websocketPromise
.then((webSocket) => {
ws = webSocket as WebSocketLike;
if (!settled && stdinStream && stdinPayload) {
if (settled) {
try {
ws.close();
} catch {
// Ignore best-effort close failures.
}
return;
}
if (stdinStream && stdinPayload) {
stdinStream.end(stdinPayload);
}
ws.on("close", (code: number, reason: Buffer) => {