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>;
|
||||
}
|
||||
|
||||
const defaultPackageMirror = "default";
|
||||
const packageMirrors = new Map<string, DownloadMirror>([
|
||||
export const defaultPackageMirror = "default";
|
||||
export const packageMirrors = new Map<string, DownloadMirror>([
|
||||
[defaultPackageMirror, {
|
||||
url: "https://storage.googleapis.com/kubernetes-release/release",
|
||||
label: "Default (Google)",
|
||||
@ -309,8 +309,3 @@ export const DESCRIPTORS = {
|
||||
editorConfiguration,
|
||||
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 { SemVer } from "semver";
|
||||
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 kubectlMap: Map<string, string> = new Map([
|
||||
@ -388,7 +388,7 @@ export class Kubectl {
|
||||
protected getDownloadMirror() {
|
||||
// MacOS packages are only available from default
|
||||
|
||||
return CONSTANTS.packageMirrors.get(UserStore.getInstance().downloadMirror)
|
||||
?? CONSTANTS.packageMirrors.get(CONSTANTS.defaultPackageMirror);
|
||||
return packageMirrors.get(UserStore.getInstance().downloadMirror)
|
||||
?? packageMirrors.get(defaultPackageMirror);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ import { observer } from "mobx-react";
|
||||
import { bundledKubectlPath } from "../../../main/kubectl";
|
||||
import { SelectOption, Select } from "../select";
|
||||
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(() => {
|
||||
const userStore = UserStore.getInstance();
|
||||
@ -35,7 +35,7 @@ export const KubectlBinaries = observer(() => {
|
||||
const [binariesPath, setBinariesPath] = useState(userStore.kubectlBinariesPath || "");
|
||||
const pathValidator = downloadPath ? InputValidators.isPath : undefined;
|
||||
const downloadMirrorOptions: SelectOption<string>[] = Array.from(
|
||||
CONSTANTS.packageMirrors.entries(),
|
||||
packageMirrors.entries(),
|
||||
([value, { label, platforms }]) => ({ value, label, platforms })
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user