mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove CONSTANTS export
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
6728e27790
commit
792f635914
@ -141,8 +141,8 @@ export interface DownloadMirror {
|
|||||||
platforms: Set<NodeJS.Platform>;
|
platforms: Set<NodeJS.Platform>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultPackageMirror = "default";
|
export const defaultPackageMirror = "default";
|
||||||
const packageMirrors = new Map<string, DownloadMirror>([
|
export const packageMirrors = new Map<string, DownloadMirror>([
|
||||||
[defaultPackageMirror, {
|
[defaultPackageMirror, {
|
||||||
url: "https://storage.googleapis.com/kubernetes-release/release",
|
url: "https://storage.googleapis.com/kubernetes-release/release",
|
||||||
label: "Default (Google)",
|
label: "Default (Google)",
|
||||||
@ -309,8 +309,3 @@ export const DESCRIPTORS = {
|
|||||||
editorConfiguration,
|
editorConfiguration,
|
||||||
terminalCopyOnSelect,
|
terminalCopyOnSelect,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CONSTANTS = {
|
|
||||||
defaultPackageMirror,
|
|
||||||
packageMirrors,
|
|
||||||
};
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import { getBundledKubectlVersion } from "../common/utils/app-version";
|
|||||||
import { isDevelopment, isWindows, isTestEnv } from "../common/vars";
|
import { isDevelopment, isWindows, isTestEnv } from "../common/vars";
|
||||||
import { SemVer } from "semver";
|
import { SemVer } from "semver";
|
||||||
import { getPath } from "../common/utils/getPath";
|
import { getPath } from "../common/utils/getPath";
|
||||||
import { CONSTANTS } from "../common/user-store/preferences-helpers";
|
import { defaultPackageMirror, packageMirrors } from "../common/user-store/preferences-helpers";
|
||||||
|
|
||||||
const bundledVersion = getBundledKubectlVersion();
|
const bundledVersion = getBundledKubectlVersion();
|
||||||
const kubectlMap: Map<string, string> = new Map([
|
const kubectlMap: Map<string, string> = new Map([
|
||||||
@ -388,7 +388,7 @@ export class Kubectl {
|
|||||||
protected getDownloadMirror() {
|
protected getDownloadMirror() {
|
||||||
// MacOS packages are only available from default
|
// MacOS packages are only available from default
|
||||||
|
|
||||||
return CONSTANTS.packageMirrors.get(UserStore.getInstance().downloadMirror)
|
return packageMirrors.get(UserStore.getInstance().downloadMirror)
|
||||||
?? CONSTANTS.packageMirrors.get(CONSTANTS.defaultPackageMirror);
|
?? packageMirrors.get(defaultPackageMirror);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import { observer } from "mobx-react";
|
|||||||
import { bundledKubectlPath } from "../../../main/kubectl";
|
import { bundledKubectlPath } from "../../../main/kubectl";
|
||||||
import { SelectOption, Select } from "../select";
|
import { SelectOption, Select } from "../select";
|
||||||
import { FormSwitch, Switcher } from "../switch";
|
import { FormSwitch, Switcher } from "../switch";
|
||||||
import { CONSTANTS } from "../../../common/user-store/preferences-helpers";
|
import { packageMirrors } from "../../../common/user-store/preferences-helpers";
|
||||||
|
|
||||||
export const KubectlBinaries = observer(() => {
|
export const KubectlBinaries = observer(() => {
|
||||||
const userStore = UserStore.getInstance();
|
const userStore = UserStore.getInstance();
|
||||||
@ -35,7 +35,7 @@ export const KubectlBinaries = observer(() => {
|
|||||||
const [binariesPath, setBinariesPath] = useState(userStore.kubectlBinariesPath || "");
|
const [binariesPath, setBinariesPath] = useState(userStore.kubectlBinariesPath || "");
|
||||||
const pathValidator = downloadPath ? InputValidators.isPath : undefined;
|
const pathValidator = downloadPath ? InputValidators.isPath : undefined;
|
||||||
const downloadMirrorOptions: SelectOption<string>[] = Array.from(
|
const downloadMirrorOptions: SelectOption<string>[] = Array.from(
|
||||||
CONSTANTS.packageMirrors.entries(),
|
packageMirrors.entries(),
|
||||||
([value, { label, platforms }]) => ({ value, label, platforms })
|
([value, { label, platforms }]) => ({ value, label, platforms })
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user