mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
25 lines
969 B
TypeScript
25 lines
969 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable } from "@ogre-tools/injectable";
|
|
import assert from "assert";
|
|
import { kubeObjectStoreInjectionToken } from "../../../common/k8s-api/api-manager/manager.injectable";
|
|
import ingressApiInjectable from "../../../common/k8s-api/endpoints/ingress.api.injectable";
|
|
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
|
import { IngressStore } from "./ingress-store";
|
|
|
|
const ingressStoreInjectable = getInjectable({
|
|
id: "ingress-store",
|
|
instantiate: (di) => {
|
|
assert(di.inject(storesAndApisCanBeCreatedInjectable), "ingressStore is only available in certain environments");
|
|
|
|
const api = di.inject(ingressApiInjectable);
|
|
|
|
return new IngressStore(api);
|
|
},
|
|
injectionToken: kubeObjectStoreInjectionToken,
|
|
});
|
|
|
|
export default ingressStoreInjectable;
|