Skip to content

Commit

Permalink
Add tslint validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Jul 14, 2018
1 parent d013987 commit 4ef9254
Show file tree
Hide file tree
Showing 10 changed files with 350 additions and 326 deletions.
2 changes: 2 additions & 0 deletions node-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"lint": "tslint --project \".\"",
"clean": "rm -Rf node_modules/ dist/",
"build": "tsc",
"watch": "tsc --watch",
Expand Down Expand Up @@ -45,6 +46,7 @@
"jasmine": "^2.8.0",
"mocha": "^3.4.2",
"ts-node": "^3.1.0",
"tslint": "^5.10.0",
"typescript": "^2.6.2"
},
"bugs": {
Expand Down
28 changes: 15 additions & 13 deletions node-client/src/attach.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import querystring = require('querystring');
import stream = require('stream');

import { WebSocketHandler } from './web-socket-handler';
import { KubeConfig } from './config';
import { WebSocketHandler } from './web-socket-handler';

export class Attach {
'handler': WebSocketHandler;
public 'handler': WebSocketHandler;

public constructor(config: KubeConfig) {
this.handler = new WebSocketHandler(config);
}
}

public attach(namespace: string, podName: string, containerName: string, stdout: stream.Writable | any, stderr: stream.Writable | any, stdin: stream.Readable | any, tty: boolean) {
var query = {
stdout: stdout != null,
public attach(namespace: string, podName: string, containerName: string,
stdout: stream.Writable | any, stderr: stream.Writable | any, stdin: stream.Readable | any,
tty: boolean) {
const query = {
container: containerName,
stderr: stderr != null,
stdin: stdin != null,
tty: tty,
container: containerName
}
var queryStr = querystring.stringify(query);
var path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;
this.handler.connect(path, null, (stream: number, buff: Buffer) => {
WebSocketHandler.handleStandardStreams(stream, buff, stdout, stderr);
stdout: stdout != null,
tty,
};
const queryStr = querystring.stringify(query);
const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;
this.handler.connect(path, null, (streamNum: number, buff: Buffer) => {
WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);
});
}
}
3 changes: 2 additions & 1 deletion node-client/src/auth-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import api = require('./api');
// These wrappers are needed until we update the swagger->TypeScript generator

// Add the ability to extend auth.
/* tslint:disable: class-name */
export class Core_v1Api extends api.Core_v1Api {
constructor(baseUri: string) {
super(baseUri);
Expand All @@ -12,6 +13,7 @@ export class Core_v1Api extends api.Core_v1Api {
}
}

/* tslint:disable: class-name */
export class Extensions_v1beta1Api extends api.Extensions_v1beta1Api {
constructor(baseUri: string) {
super(baseUri);
Expand All @@ -22,4 +24,3 @@ export class Extensions_v1beta1Api extends api.Extensions_v1beta1Api {
}

// TODO: Add other API objects here

Loading

0 comments on commit 4ef9254

Please sign in to comment.