Skip to content
Open
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
3,305 changes: 1,597 additions & 1,708 deletions kind-cluster-provider/package-lock.json

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions kind-cluster-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.1",
"publisher": "ms-kubernetes-tools",
"engines": {
"vscode": "^1.32.0"
"vscode": "^1.101.0"
},
"categories": [
"Other"
Expand All @@ -21,19 +21,21 @@
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"postinstall": "npx @vscode/dts dev && npm run compile",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
"extensionDependencies": [
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"devDependencies": {
"typescript": "^2.6.1",
"vscode": "^1.1.21",
"tslint": "^5.8.0",
"@types/node": "^8.10.25",
"@types/mocha": "^2.2.42",
"@types/shelljs": "^0.8.3"
"typescript": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^20.0.0",
"@types/shelljs": "^0.8.3",
"@types/vscode": "^1.101.0",
"@vscode/dts": "^0.4.0"
},
"dependencies": {
"shelljs": "^0.8.3",
Expand Down
20 changes: 12 additions & 8 deletions kind-cluster-provider/src/kind-cluster-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ function createCluster(previousData: any): k8s.ClusterProviderV1.Observable<stri
const imageVersion: string = previousData[SETTING_IMAGE_VERSION];
const imageArg = (imageVersion && imageVersion.length > 0) ? `--image kindest/node:${imageVersion}` : '';
const childProcess = shelljs.exec(`kind create cluster --name ${clusterName} ${imageArg}`, { async: true }) as ChildProcess;
childProcess.stdout.on('data', (chunk: string) => {
stdout += chunk;
observer.onNext(html());
});
childProcess.stderr.on('data', (chunk: string) => {
stderr += chunk;
observer.onNext(html());
});
if (childProcess.stdout) {
childProcess.stdout.on('data', (chunk: string) => {
stdout += chunk;
observer.onNext(html());
});
}
if (childProcess.stderr) {
childProcess.stderr.on('data', (chunk: string) => {
stderr += chunk;
observer.onNext(html());
});
}
childProcess.on('error', (err: Error) => {
stderr += err.message;
observer.onNext(html());
Expand Down
2 changes: 1 addition & 1 deletion kind-cluster-provider/src/utils/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function execObj<T>(cmd: string, cmdDesc: string, opts: ExecOpts, fn: ((st
function execCore(cmd: string, opts: any, stdin?: string): Promise<ShellResult> {
return new Promise<ShellResult>((resolve, _reject) => {
const proc = shelljs.exec(cmd, opts, (code, stdout, stderr) => resolve({ code: code, stdout: stdout, stderr: stderr }));
if (stdin) {
if (stdin && proc.stdin) {
proc.stdin.end(stdin);
}
});
Expand Down
Loading