Skip to content

Commit de5c2aa

Browse files
Merge pull request #60 from brendandburns/master
Add tslint validation.
2 parents d013987 + 4ef9254 commit de5c2aa

10 files changed

+350
-326
lines changed

node-client/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"main": "dist/index.js",
1414
"types": "dist/index.d.ts",
1515
"scripts": {
16+
"lint": "tslint --project \".\"",
1617
"clean": "rm -Rf node_modules/ dist/",
1718
"build": "tsc",
1819
"watch": "tsc --watch",
@@ -45,6 +46,7 @@
4546
"jasmine": "^2.8.0",
4647
"mocha": "^3.4.2",
4748
"ts-node": "^3.1.0",
49+
"tslint": "^5.10.0",
4850
"typescript": "^2.6.2"
4951
},
5052
"bugs": {

node-client/src/attach.ts

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
import querystring = require('querystring');
22
import stream = require('stream');
33

4-
import { WebSocketHandler } from './web-socket-handler';
54
import { KubeConfig } from './config';
5+
import { WebSocketHandler } from './web-socket-handler';
66

77
export class Attach {
8-
'handler': WebSocketHandler;
8+
public 'handler': WebSocketHandler;
99

1010
public constructor(config: KubeConfig) {
1111
this.handler = new WebSocketHandler(config);
12-
}
12+
}
1313

14-
public attach(namespace: string, podName: string, containerName: string, stdout: stream.Writable | any, stderr: stream.Writable | any, stdin: stream.Readable | any, tty: boolean) {
15-
var query = {
16-
stdout: stdout != null,
14+
public attach(namespace: string, podName: string, containerName: string,
15+
stdout: stream.Writable | any, stderr: stream.Writable | any, stdin: stream.Readable | any,
16+
tty: boolean) {
17+
const query = {
18+
container: containerName,
1719
stderr: stderr != null,
1820
stdin: stdin != null,
19-
tty: tty,
20-
container: containerName
21-
}
22-
var queryStr = querystring.stringify(query);
23-
var path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;
24-
this.handler.connect(path, null, (stream: number, buff: Buffer) => {
25-
WebSocketHandler.handleStandardStreams(stream, buff, stdout, stderr);
21+
stdout: stdout != null,
22+
tty,
23+
};
24+
const queryStr = querystring.stringify(query);
25+
const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;
26+
this.handler.connect(path, null, (streamNum: number, buff: Buffer) => {
27+
WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);
2628
});
2729
}
2830
}

node-client/src/auth-wrapper.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import api = require('./api');
33
// These wrappers are needed until we update the swagger->TypeScript generator
44

55
// Add the ability to extend auth.
6+
/* tslint:disable: class-name */
67
export class Core_v1Api extends api.Core_v1Api {
78
constructor(baseUri: string) {
89
super(baseUri);
@@ -12,6 +13,7 @@ export class Core_v1Api extends api.Core_v1Api {
1213
}
1314
}
1415

16+
/* tslint:disable: class-name */
1517
export class Extensions_v1beta1Api extends api.Extensions_v1beta1Api {
1618
constructor(baseUri: string) {
1719
super(baseUri);
@@ -22,4 +24,3 @@ export class Extensions_v1beta1Api extends api.Extensions_v1beta1Api {
2224
}
2325

2426
// TODO: Add other API objects here
25-

0 commit comments

Comments
 (0)