diff --git a/src/common/cluster/cluster.ts b/src/common/cluster/cluster.ts
index 37110bcb3c..517393a6bb 100644
--- a/src/common/cluster/cluster.ts
+++ b/src/common/cluster/cluster.ts
@@ -27,6 +27,7 @@ import assert from "assert";
import type { Logger } from "../logger";
import type { ReadFileSync } from "../fs/read-file-sync.injectable";
import type { EmitClusterConnectionUpdate } from "../../main/cluster/emit-connection-update.injectable";
+import type { CreateKubectl } from "../../main/kubectl/create-kubectl.injectable";
export interface ClusterDependencies {
readonly directoryForKubeConfigs: string;
@@ -34,7 +35,7 @@ export interface ClusterDependencies {
readonly detectorRegistry: DetectorRegistry;
createKubeconfigManager: (cluster: Cluster) => KubeconfigManager;
createContextHandler: (cluster: Cluster) => ClusterContextHandler;
- createKubectl: (clusterVersion: string) => Kubectl;
+ createKubectl: CreateKubectl;
createAuthorizationReview: (config: KubeConfig) => CanI;
createListNamespaces: (config: KubeConfig) => ListNamespaces;
createVersionDetector: (cluster: Cluster) => VersionDetector;
diff --git a/src/common/cluster/get-by-id.injectable.ts b/src/common/cluster/get-by-id.injectable.ts
new file mode 100644
index 0000000000..72140b4886
--- /dev/null
+++ b/src/common/cluster/get-by-id.injectable.ts
@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) OpenLens Authors. All rights reserved.
+ * Licensed under MIT License. See LICENSE in root directory for more information.
+ */
+
+import type { ClusterId } from "../cluster-types";
+import type { Cluster } from "./cluster";
+import { getInjectable } from "@ogre-tools/injectable";
+import clusterStoreInjectable from "../cluster-store/cluster-store.injectable";
+
+export type GetClusterById = (id: ClusterId) => Cluster | undefined;
+
+const getClusterByIdInjectable = getInjectable({
+ id: "get-cluster-by-id",
+ instantiate: (di): GetClusterById => {
+ const store = di.inject(clusterStoreInjectable);
+
+ return (id) => store.getById(id);
+ },
+});
+
+export default getClusterByIdInjectable;
diff --git a/src/common/cluster/set-visible-channel.injectable.ts b/src/common/cluster/set-visible-channel.injectable.ts
new file mode 100644
index 0000000000..a89659701d
--- /dev/null
+++ b/src/common/cluster/set-visible-channel.injectable.ts
@@ -0,0 +1,25 @@
+/**
+ * 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 type { ClusterId } from "../cluster-types";
+import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
+
+export type SetVisibleClusterMessage = {
+ action: "set";
+ clusterId: ClusterId;
+} | {
+ action: "clear";
+};
+
+export type SetVisibleClusterChannel = MessageChannel
++ ++ Connecting + … +
+