diff --git a/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.ts b/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.ts index 8392194a2b..12e74cdc1f 100644 --- a/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.ts +++ b/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.ts @@ -3,26 +3,19 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import assert from "assert"; import type { ClusterContext } from "./cluster-frame-context"; -import hostedClusterInjectable from "./hosted-cluster.injectable"; const clusterFrameContextForClusterScopedResourcesInjectable = getInjectable({ id: "cluster-frame-context-for-cluster-scoped-resources", - instantiate: (di): ClusterContext => { - const cluster = di.inject(hostedClusterInjectable); - - assert(cluster, "This can only be injected within a cluster frame"); - - return { - isGlobalWatchEnabled: () => cluster.isGlobalWatchEnabled, - // This is always the case for cluster scoped resources - isLoadingAll: () => true, - allNamespaces: [], - contextNamespaces: [], // This value is used as a sentinal - hasSelectedAll: true, - }; - }, + instantiate: (): ClusterContext => ({ + // This doesn't matter as it is an optimization for namespaced resources only + isGlobalWatchEnabled: () => true, + // This is always the case for cluster scoped resources + isLoadingAll: () => true, + allNamespaces: [], + contextNamespaces: [], + hasSelectedAll: true, + }), }); export default clusterFrameContextForClusterScopedResourcesInjectable;