Fix use of bundled kubectl (#241)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-04-11 17:48:29 +03:00
1 parent 758034f61a
commit d80e956870
5 files changed
+45 -3

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
const userStore = {
getPreferences: jest.fn(() => {
return {
downloadMirror: "default"
}
})
}
export { userStore };
+3 -2
View File
@@ -11,6 +11,7 @@ import * as lockFile from "proper-lockfile"
import { helmCli } from "./helm-cli"
import { userStore } from "../common/user-store"
const bundledVersion = require("../../package.json").config.bundledKubectlVersion
const kubectlMap: Map<string, string> = new Map([
["1.7", "1.8.15"],
["1.8", "1.9.10"],
@@ -22,7 +23,7 @@ const kubectlMap: Map<string, string> = new Map([
["1.14", "1.14.10"],
["1.15", "1.15.11"],
["1.16", "1.16.8"],
["1.17", "1.17.4"],
["1.17", bundledVersion],
["1.18", "1.18.0"]
])
@@ -54,7 +55,7 @@ export class Kubectl {
public static readonly kubectlDir = path.join((app || remote.app).getPath("userData"), "binaries", "kubectl")
public static readonly bundledKubectlPath = bundledPath
public static readonly bundledKubectlVersion: string = require("../../package.json").config.bundledKubectlVersion
public static readonly bundledKubectlVersion: string = bundledVersion
private static bundledInstance: Kubectl;
// Returns the single bundled Kubectl instance