mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
27 lines
934 B
TypeScript
27 lines
934 B
TypeScript
/**
|
|
* 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 type { HelmRepo } from "../../common/helm/helm-repo";
|
|
import { HelmChartManager } from "./helm-chart-manager";
|
|
import helmChartManagerCacheInjectable from "./helm-chart-manager-cache.injectable";
|
|
import loggerInjectable from "../../common/logger.injectable";
|
|
|
|
const helmChartManagerInjectable = getInjectable({
|
|
id: "helm-chart-manager",
|
|
|
|
instantiate: (di, repo: HelmRepo) => {
|
|
const cache = di.inject(helmChartManagerCacheInjectable);
|
|
const logger = di.inject(loggerInjectable);
|
|
|
|
return new HelmChartManager(repo, { cache, logger });
|
|
},
|
|
|
|
lifecycle: lifecycleEnum.keyedSingleton({
|
|
getInstanceKey: (di, repo: HelmRepo) => repo.name,
|
|
}),
|
|
});
|
|
|
|
export default helmChartManagerInjectable;
|