mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update injectable library (#4842)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
e8ca1ddf87
commit
b65f6e00ec
231 files changed
+630
-613
No files matched your search
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getBundledKubectlVersion } from "../../common/utils";
|
||||
import createKubectlInjectable from "./create-kubectl.injectable";
|
||||
|
||||
const bundledKubectlInjectable = getInjectable({
|
||||
id: "bundled-kubectl",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createKubectl = di.inject(createKubectlInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const bundledKubectlInjectable = getInjectable({
|
||||
|
||||
return createKubectl(bundledKubectlVersion);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default bundledKubectlInjectable;
|
||||
@@ -2,12 +2,14 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { Kubectl } from "./kubectl";
|
||||
import directoryForKubectlBinariesInjectable from "./directory-for-kubectl-binaries/directory-for-kubectl-binaries.injectable";
|
||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||
|
||||
const createKubectlInjectable = getInjectable({
|
||||
id: "create-kubectl",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dependencies = {
|
||||
userStore: di.inject(userStoreInjectable),
|
||||
@@ -20,8 +22,6 @@ const createKubectlInjectable = getInjectable({
|
||||
return (clusterVersion: string) =>
|
||||
new Kubectl(dependencies, clusterVersion);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createKubectlInjectable;
|
||||
+3
-3
@@ -2,15 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import directoryForBinariesInjectable from "../../../common/app-paths/directory-for-binaries/directory-for-binaries.injectable";
|
||||
import path from "path";
|
||||
|
||||
const directoryForKubectlBinariesInjectable = getInjectable({
|
||||
id: "directory-for-kubectl-binaries",
|
||||
|
||||
instantiate: (di) =>
|
||||
path.join(di.inject(directoryForBinariesInjectable), "kubectl"),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default directoryForKubectlBinariesInjectable;
|
||||
Reference in new issue
Block a user