Skip to content

Commit 4b26a86

Browse files
fixing sonar issue (#122)
1 parent 3638dbe commit 4b26a86

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

electron/app/js/k8sUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function getKubeConfig() {
1717
kubeConfig = process.env.KUBECONFIG.split(path.delimiter);
1818
} else {
1919
const userHomeDir = osUtils.isWindows() ? process.env.USERPROFILE : process.env.HOME;
20-
kubeConfig = path.normalize(path.join(userHomeDir, '.kube', 'config'));
20+
kubeConfig = [ path.normalize(path.join(userHomeDir, '.kube', 'config')) ];
2121
}
2222
return kubeConfig;
2323
}

webui/src/js/models/kubectl-definition.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@ define(['utils/observable-properties'],
1818
return function (name) {
1919
return {
2020
k8sFlavor: props.createProperty('OKE'),
21-
kubeConfig: props.createArrayProperty(() => {
22-
const kubeConfig = window.api.k8s.getKubeConfig();
23-
if (kubeConfig) {
24-
if (Array.isArray(kubeConfig)) {
25-
return kubeConfig;
26-
} else {
27-
return [ kubeConfig ];
28-
}
29-
}
30-
return [];
31-
}),
21+
kubeConfig: props.createArrayProperty(window.api.k8s.getKubeConfig()),
3222
executableFilePath: props.createProperty(window.api.k8s.getKubectlFilePath()),
3323
kubeConfigContextToUse: props.createProperty(),
3424
helmExecutableFilePath: props.createProperty(window.api.k8s.getHelmFilePath()),

webui/src/test/window-stub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class WindowStub {
3030
const api = {
3131
k8s : {
3232
getKubeConfig: () => {
33-
return 'fake-kube-config';
33+
return ['fake-kube-config'];
3434
},
3535
getKubectlFilePath: () => {
3636
return '/fake/kubectl';

0 commit comments

Comments
 (0)