Fix addCustomRepo getResources error output

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-12-13 11:52:42 -05:00
1 parent 844b7be954
commit e7045727d4
3 files changed
+9 -5

No files matched your search

+5 -3
View File
@@ -223,15 +223,16 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str
return new Promise((resolve, reject) => {
let stdout = "";
let stderr = "";
const kubectl = execFile(kubectlPath, kubectlArgs);
kubectl
.on("exit", (code, signal) => {
if (typeof code === "number") {
if (code) {
reject(new Error(`Kubectl exited with code ${code}`));
} else {
if (code === 0) {
resolve(JSON.parse(stdout).items);
} else {
reject(stderr);
}
} else {
reject(new Error(`Kubectl exited with signal ${signal}`));
@@ -239,6 +240,7 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str
})
.on("error", reject);
kubectl.stderr.on("data", output => stderr += output);
kubectl.stdout.on("data", output => stdout += output);
kubectl.stdin.write(helmOutput);
kubectl.stdin.end();
+2
View File
@@ -178,6 +178,8 @@ export class HelmRepoManager extends Singleton {
const args = [
"repo",
"add",
name,
url,
];
if (insecureSkipTlsVerify) {
@@ -121,7 +121,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
<div className="flex gaps align-center">
<Input
placeholder={placeholder}
validators = {isPath}
validators={isPath}
className="box grow"
value={this.getFilePath(fileType)}
onChange={v => this.setFilepath(fileType, v)}
@@ -172,7 +172,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
close={this.close}
>
<Wizard header={header} done={this.close}>
<WizardStep contentClass="flow column" nextLabel="Add" next={()=>{this.addCustomRepo();}}>
<WizardStep contentClass="flow column" nextLabel="Add" next={() => this.addCustomRepo()}>
<div className="flex column gaps">
<Input
autoFocus required