1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/k8s-api/endpoints/pod.api.injectable.ts
2022-07-27 11:44:11 -04:00

24 lines
753 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 { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { PodApi } from "./pod.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
const podApiInjectable = getInjectable({
id: "pod-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "podApi is only available in certain environments");
return new PodApi();
},
injectionToken: kubeApiInjectionToken,
});
export default podApiInjectable;