Skip to content

Commit 61de83e

Browse files
maxpainbrendandburns
authored andcommitted
Return connection in attach method (#195)
* Return connection in attach method For the ability to close WebSocket connections. * return websocket type instead of void * missed semicolon * missed semicolon
1 parent ef46c77 commit 61de83e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/attach.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import WebSocket = require('isomorphic-ws');
12
import querystring = require('querystring');
23
import stream = require('stream');
34

@@ -17,7 +18,7 @@ export class Attach {
1718

1819
public async attach(namespace: string, podName: string, containerName: string,
1920
stdout: stream.Writable | any, stderr: stream.Writable | any, stdin: stream.Readable | any,
20-
tty: boolean): Promise<void> {
21+
tty: boolean): Promise<WebSocket> {
2122
const query = {
2223
container: containerName,
2324
stderr: stderr != null,
@@ -34,5 +35,7 @@ export class Attach {
3435
if (stdin != null) {
3536
WebSocketHandler.handleStandardInput(conn, stdin);
3637
}
38+
39+
return conn;
3740
}
3841
}

0 commit comments

Comments
 (0)