Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tslint validation. #60

Merged
merged 1 commit into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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