@k8slens/extensions 6.3.0-git.7b5e1b8a31.0 → 6.3.0-git.95cee3bcc8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common/certificate-authorities/inject-system-cas.injectable.d.ts +6 -0
- package/dist/src/common/certificate-authorities/request-system-cas-token.d.ts +5 -0
- package/dist/src/common/certificate-authorities/request-system-cas.injectable.darwin.d.ts +2 -0
- package/dist/src/common/certificate-authorities/request-system-cas.injectable.linux.d.ts +2 -0
- package/dist/src/common/certificate-authorities/request-system-cas.injectable.testing-env.d.ts +2 -0
- package/dist/src/common/certificate-authorities/request-system-cas.injectable.win32.d.ts +2 -0
- package/dist/src/common/cluster/authorization-namespace-review.injectable.d.ts +19 -0
- package/dist/src/common/cluster/authorization-review.injectable.d.ts +8 -3
- package/dist/src/common/cluster/cluster.d.ts +13 -6
- package/dist/src/common/cluster/list-api-resources.injectable.d.ts +13 -0
- package/dist/src/common/cluster/visibility-channel.d.ts +7 -0
- package/dist/src/common/cluster-types.d.ts +0 -6
- package/dist/src/common/fs/exec-file.injectable.d.ts +6 -3
- package/dist/src/common/ipc/cluster.d.ts +0 -1
- package/dist/src/common/k8s-api/endpoints/helm-releases.api/request-update.injectable.d.ts +2 -6
- package/dist/src/extensions/extension-api.js +4 -4
- package/dist/src/main/cluster/manager.d.ts +2 -2
- package/dist/src/main/cluster/visibility-handler.injectable.d.ts +5 -0
- package/dist/src/main/cluster/visible-cluster.injectable.d.ts +2 -0
- package/dist/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.d.ts +1 -3
- package/dist/src/main/helm/exec-helm/exec-env.global-override-for-injectable.d.ts +9 -0
- package/dist/src/main/helm/exec-helm/exec-env.injectable.d.ts +2 -0
- package/dist/src/main/helm/helm-service/update-helm-release.injectable.d.ts +1 -2
- package/dist/src/renderer/components/cluster-manager/cluster-frame-handler.d.ts +11 -1
- package/dist/src/renderer/components/cluster-manager/emit-cluster-visibility.injectable.d.ts +5 -0
- package/dist/src/renderer/components/dock/upgrade-chart/upgrade-chart-model.injectable.d.ts +2 -4
- package/dist/src/renderer/components/dock/upgrade-chart/view.d.ts +1 -1
- package/dist/src/test-utils/skippers.d.ts +13 -0
- package/package.json +1 -1
- package/dist/src/common/__tests__/system-ca.test.d.ts +0 -1
- package/dist/src/common/system-ca.d.ts +0 -24
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
declare const injectSystemCAsInjectable: import("@ogre-tools/injectable").Injectable<() => Promise<void>, unknown, void>;
|
6
|
+
export default injectSystemCAsInjectable;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
export declare const requestSystemCAsInjectionToken: import("@ogre-tools/injectable").InjectionToken<() => Promise<string[]>, void>;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
import type { KubeConfig } from "@kubernetes/client-node";
|
6
|
+
import type { KubeApiResource } from "../rbac";
|
7
|
+
/**
|
8
|
+
* Requests the permissions for actions on the kube cluster
|
9
|
+
* @param namespace The namespace of the resources
|
10
|
+
* @param availableResources List of available resources in the cluster to resolve glob values fir api groups
|
11
|
+
* @returns list of allowed resources names
|
12
|
+
*/
|
13
|
+
export type RequestNamespaceResources = (namespace: string, availableResources: KubeApiResource[]) => Promise<string[]>;
|
14
|
+
/**
|
15
|
+
* @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
|
16
|
+
*/
|
17
|
+
export type AuthorizationNamespaceReview = (proxyConfig: KubeConfig) => RequestNamespaceResources;
|
18
|
+
declare const authorizationNamespaceReviewInjectable: import("@ogre-tools/injectable").Injectable<AuthorizationNamespaceReview, unknown, void>;
|
19
|
+
export default authorizationNamespaceReviewInjectable;
|
@@ -3,10 +3,15 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
import type { KubeConfig, V1ResourceAttributes } from "@kubernetes/client-node";
|
6
|
+
/**
|
7
|
+
* Requests the permissions for actions on the kube cluster
|
8
|
+
* @param resourceAttributes The descriptor of the action that is desired to be known if it is allowed
|
9
|
+
* @returns `true` if the actions described are allowed
|
10
|
+
*/
|
6
11
|
export type CanI = (resourceAttributes: V1ResourceAttributes) => Promise<boolean>;
|
7
12
|
/**
|
8
13
|
* @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
|
9
|
-
|
10
|
-
export
|
11
|
-
declare const authorizationReviewInjectable: import("@ogre-tools/injectable").Injectable<
|
14
|
+
*/
|
15
|
+
export type AuthorizationReview = (proxyConfig: KubeConfig) => CanI;
|
16
|
+
declare const authorizationReviewInjectable: import("@ogre-tools/injectable").Injectable<AuthorizationReview, unknown, void>;
|
12
17
|
export default authorizationReviewInjectable;
|
@@ -9,13 +9,15 @@ import type { KubeconfigManager } from "../../main/kubeconfig-manager/kubeconfig
|
|
9
9
|
import type { KubeResource } from "../rbac";
|
10
10
|
import type { VersionDetector } from "../../main/cluster-detectors/version-detector";
|
11
11
|
import type { DetectorRegistry } from "../../main/cluster-detectors/detector-registry";
|
12
|
-
import type { ClusterState,
|
12
|
+
import type { ClusterState, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, ClusterConfigData } from "../cluster-types";
|
13
13
|
import { ClusterStatus } from "../cluster-types";
|
14
14
|
import type { CanI } from "./authorization-review.injectable";
|
15
15
|
import type { ListNamespaces } from "./list-namespaces.injectable";
|
16
16
|
import type { Logger } from "../logger";
|
17
17
|
import type { BroadcastMessage } from "../ipc/broadcast-message.injectable";
|
18
18
|
import type { LoadConfigfromFile } from "../kube-helpers/load-config-from-file.injectable";
|
19
|
+
import type { RequestNamespaceResources } from "./authorization-namespace-review.injectable";
|
20
|
+
import type { RequestListApiResources } from "./list-api-resources.injectable";
|
19
21
|
export interface ClusterDependencies {
|
20
22
|
readonly directoryForKubeConfigs: string;
|
21
23
|
readonly logger: Logger;
|
@@ -24,6 +26,8 @@ export interface ClusterDependencies {
|
|
24
26
|
createContextHandler: (cluster: Cluster) => ClusterContextHandler;
|
25
27
|
createKubectl: (clusterVersion: string) => Kubectl;
|
26
28
|
createAuthorizationReview: (config: KubeConfig) => CanI;
|
29
|
+
createAuthorizationNamespaceReview: (config: KubeConfig) => RequestNamespaceResources;
|
30
|
+
createListApiResources: (cluster: Cluster) => RequestListApiResources;
|
27
31
|
createListNamespaces: (config: KubeConfig) => ListNamespaces;
|
28
32
|
createVersionDetector: (cluster: Cluster) => VersionDetector;
|
29
33
|
broadcastMessage: BroadcastMessage;
|
@@ -225,16 +229,19 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
225
229
|
disconnect(): void;
|
226
230
|
/**
|
227
231
|
* @internal
|
228
|
-
* @param opts refresh options
|
229
232
|
*/
|
230
|
-
refresh(
|
233
|
+
refresh(): Promise<void>;
|
231
234
|
/**
|
232
235
|
* @internal
|
233
236
|
*/
|
237
|
+
refreshAccessibilityAndMetadata(): Promise<void>;
|
238
|
+
/**
|
239
|
+
* @internal
|
240
|
+
*/
|
234
241
|
refreshMetadata(): Promise<void>;
|
235
242
|
/**
|
236
|
-
|
237
|
-
|
243
|
+
* @internal
|
244
|
+
*/
|
238
245
|
private refreshAccessibility;
|
239
246
|
/**
|
240
247
|
* @internal
|
@@ -279,7 +286,7 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
279
286
|
*/
|
280
287
|
broadcastConnectUpdate(message: string, isError?: boolean): void;
|
281
288
|
protected getAllowedNamespaces(proxyConfig: KubeConfig): Promise<string[]>;
|
282
|
-
protected getAllowedResources(
|
289
|
+
protected getAllowedResources(listApiResources: RequestListApiResources, requestNamespaceResources: RequestNamespaceResources): Promise<KubeResource[]>;
|
283
290
|
isAllowedResource(kind: string): boolean;
|
284
291
|
isMetricHidden(resource: ClusterMetricsResourceType): boolean;
|
285
292
|
get nodeShellImage(): string;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
import type { KubeApiResource } from "../rbac";
|
6
|
+
import type { Cluster } from "./cluster";
|
7
|
+
export type RequestListApiResources = () => Promise<KubeApiResource[]>;
|
8
|
+
/**
|
9
|
+
* @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
|
10
|
+
*/
|
11
|
+
export type ListApiResources = (cluster: Cluster) => RequestListApiResources;
|
12
|
+
declare const listApiResourcesInjectable: import("@ogre-tools/injectable").Injectable<ListApiResources, unknown, void>;
|
13
|
+
export default listApiResourcesInjectable;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
import type { ClusterId } from "../cluster-types";
|
6
|
+
import type { MessageChannel } from "../utils/channel/message-channel-listener-injection-token";
|
7
|
+
export declare const clusterVisibilityChannel: MessageChannel<ClusterId | null>;
|
@@ -150,12 +150,6 @@ export declare enum ClusterMetricsResourceType {
|
|
150
150
|
* The default node shell image
|
151
151
|
*/
|
152
152
|
export declare const initialNodeShellImage = "docker.io/alpine:3.13";
|
153
|
-
/**
|
154
|
-
* The arguments for requesting to refresh a cluster's metadata
|
155
|
-
*/
|
156
|
-
export interface ClusterRefreshOptions {
|
157
|
-
refreshMetadata?: boolean;
|
158
|
-
}
|
159
153
|
/**
|
160
154
|
* The data representing a cluster's state, for passing between main and renderer
|
161
155
|
*/
|
@@ -1,10 +1,13 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import type { ExecFileException, ExecFileOptions } from "child_process";
|
3
3
|
import type { AsyncResult } from "../utils/async-result";
|
4
|
+
export type ExecFileError = ExecFileException & {
|
5
|
+
stderr: string;
|
6
|
+
};
|
4
7
|
export interface ExecFile {
|
5
|
-
(filePath: string
|
6
|
-
|
7
|
-
|
8
|
+
(filePath: string): Promise<AsyncResult<string, ExecFileError>>;
|
9
|
+
(filePath: string, argsOrOptions: string[] | ExecFileOptions): Promise<AsyncResult<string, ExecFileError>>;
|
10
|
+
(filePath: string, args: string[], options: ExecFileOptions): Promise<AsyncResult<string, ExecFileError>>;
|
8
11
|
}
|
9
12
|
declare const execFileInjectable: import("@ogre-tools/injectable").Injectable<ExecFile, unknown, void>;
|
10
13
|
export default execFileInjectable;
|
@@ -5,7 +5,6 @@
|
|
5
5
|
export declare const clusterActivateHandler = "cluster:activate";
|
6
6
|
export declare const clusterSetFrameIdHandler = "cluster:set-frame-id";
|
7
7
|
export declare const clusterVisibilityHandler = "cluster:visibility";
|
8
|
-
export declare const clusterRefreshHandler = "cluster:refresh";
|
9
8
|
export declare const clusterDisconnectHandler = "cluster:disconnect";
|
10
9
|
export declare const clusterKubectlApplyAllHandler = "cluster:kubectl-apply-all";
|
11
10
|
export declare const clusterKubectlDeleteAllHandler = "cluster:kubectl-delete-all";
|
@@ -1,14 +1,10 @@
|
|
1
|
+
import type { AsyncResult } from "../../../utils/async-result";
|
1
2
|
interface HelmReleaseUpdatePayload {
|
2
3
|
repo: string;
|
3
4
|
chart: string;
|
4
5
|
version: string;
|
5
6
|
values: string;
|
6
7
|
}
|
7
|
-
export type RequestHelmReleaseUpdate = (name: string, namespace: string, payload: HelmReleaseUpdatePayload) => Promise<
|
8
|
-
updateWasSuccessful: true;
|
9
|
-
} | {
|
10
|
-
updateWasSuccessful: false;
|
11
|
-
error: unknown;
|
12
|
-
}>;
|
8
|
+
export type RequestHelmReleaseUpdate = (name: string, namespace: string, payload: HelmReleaseUpdatePayload) => Promise<AsyncResult<void, unknown>>;
|
13
9
|
declare const requestHelmReleaseUpdateInjectable: import("@ogre-tools/injectable").Injectable<RequestHelmReleaseUpdate, unknown, void>;
|
14
10
|
export default requestHelmReleaseUpdateInjectable;
|
@@ -29812,7 +29812,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
29812
29812
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
29813
29813
|
|
29814
29814
|
"use strict";
|
29815
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Cluster\": () => (/* binding */ Cluster)\n/* harmony export */ });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! assert */ \"assert\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(assert__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n get contextHandler() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._contextHandler, \"contextHandler is only defined in the main environment\");\n return this._contextHandler;\n }\n get proxyKubeconfigManager() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._proxyKubeconfigManager, \"proxyKubeconfigManager is only defined in the main environment\");\n return this._proxyKubeconfigManager;\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_7__.when)(() => this.ready);\n }\n /**\n * Is cluster available\n *\n * @computed\n */\n get available() {\n return this.accessible && !this.disconnected;\n }\n /**\n * Cluster name\n *\n * @computed\n */\n get name() {\n return this.preferences.clusterName || this.contextName;\n }\n /**\n * The detected kubernetes distribution\n */\n get distribution() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.DISTRIBUTION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * The detected kubernetes version\n */\n get version() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.VERSION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * Prometheus preferences\n *\n * @computed\n * @internal\n */\n get prometheusPreferences() {\n const { prometheus, prometheusProvider } = this.preferences;\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\n }\n constructor(dependencies, { id, ...model }, configData) {\n Object.defineProperty(this, \"dependencies\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: dependencies\n });\n /** Unique id for a cluster */\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"kubeCtl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Context handler\n *\n * @internal\n */\n Object.defineProperty(this, \"_contextHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_proxyKubeconfigManager\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventsDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.disposer)()\n });\n Object.defineProperty(this, \"activated\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"resourceAccessStatuses\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n /**\n * Kubeconfig context name\n *\n * @observable\n */\n Object.defineProperty(this, \"contextName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Path to kubeconfig\n *\n * @observable\n */\n Object.defineProperty(this, \"kubeConfigPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspace\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Kubernetes API server URL\n *\n * @observable\n */\n Object.defineProperty(this, \"apiUrl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n }); // cluster server url\n /**\n * Is cluster online\n *\n * @observable\n */\n Object.defineProperty(this, \"online\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // describes if we can detect that cluster is online\n /**\n * Can user access cluster resources\n *\n * @observable\n */\n Object.defineProperty(this, \"accessible\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // if user is able to access cluster resources\n /**\n * Is cluster instance in usable state\n *\n * @observable\n */\n Object.defineProperty(this, \"ready\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // cluster is in usable state\n /**\n * Is cluster currently reconnecting\n *\n * @observable\n */\n Object.defineProperty(this, \"reconnecting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Is cluster disconnected. False if user has selected to connect.\n *\n * @observable\n */\n Object.defineProperty(this, \"disconnected\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n });\n /**\n * Does user have admin like access\n *\n * @observable\n */\n Object.defineProperty(this, \"isAdmin\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Global watch-api accessibility , e.g. \"/api/v1/services?watch=1\"\n *\n * @observable\n */\n Object.defineProperty(this, \"isGlobalWatchEnabled\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Preferences\n *\n * @observable\n */\n Object.defineProperty(this, \"preferences\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * Metadata\n *\n * @observable\n */\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * List of allowed namespaces verified via K8S::SelfSubjectAccessReview api\n *\n * @observable\n */\n Object.defineProperty(this, \"allowedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * List of allowed resources\n *\n * @observable\n * @internal\n */\n Object.defineProperty(this, \"allowedResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * List of accessible namespaces provided by user in the Cluster Settings\n *\n * @observable\n */\n Object.defineProperty(this, \"accessibleNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * Labels for the catalog entity\n */\n Object.defineProperty(this, \"labels\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n (0,mobx__WEBPACK_IMPORTED_MODULE_7__.makeObservable)(this);\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.clusterModelIdChecker.validate({ id });\n if (error) {\n throw error;\n }\n this.id = id;\n this.updateModel(model);\n this.apiUrl = configData.clusterServerUrl;\n // for the time being, until renderer gets its own cluster type\n this._contextHandler = this.dependencies.createContextHandler(this);\n this._proxyKubeconfigManager = this.dependencies.createKubeconfigManager(this);\n this.dependencies.logger.debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n /**\n * Update cluster data model\n *\n * @param model\n */\n updateModel(model) {\n // Note: do not assign ID as that should never be updated\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.updateClusterModelChecker.validate(model, { allowUnknown: true });\n if (error) {\n throw error;\n }\n this.kubeConfigPath = model.kubeConfigPath;\n this.contextName = model.contextName;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.preferences) {\n this.preferences = model.preferences;\n }\n if (model.metadata) {\n this.metadata = model.metadata;\n }\n if (model.accessibleNamespaces) {\n this.accessibleNamespaces = model.accessibleNamespaces;\n }\n if (model.labels) {\n this.labels = model.labels;\n }\n }\n /**\n * @internal\n */\n bindEvents() {\n this.dependencies.logger.info(`[CLUSTER]: bind events`, this.getMeta());\n const refreshTimer = setInterval(() => !this.disconnected && this.refresh(), 30000); // every 30s\n const refreshMetadataTimer = setInterval(() => !this.disconnected && this.refreshMetadata(), 900000); // every 15 minutes\n this.eventsDisposer.push((0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.getState(), state => this.pushState(state)), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_7__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n this.dependencies.logger.info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: failed to recreate proxy kubeconfig`, error);\n }\n }\n /**\n * @param force force activation\n * @internal\n */\n async activate(force = false) {\n if (this.activated && !force) {\n return this.pushState();\n }\n this.dependencies.logger.info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Starting connection ...\");\n await this.reconnect();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to start connection: ${error}`, true);\n return;\n }\n }\n try {\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to connection status: ${error}`, true);\n return;\n }\n if (this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to refresh accessibility: ${error}`, true);\n return;\n }\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => this.dependencies.logger.warn(`[CLUSTER]: failed to download kubectl for clusterId=${this.id}`, error));\n this.broadcastConnectUpdate(\"Connected, waiting for view to load ...\");\n }\n this.activated = true;\n this.pushState();\n }\n /**\n * @internal\n */\n async ensureKubectl() {\n var _a;\n (_a = this.kubeCtl) !== null && _a !== void 0 ? _a : (this.kubeCtl = this.dependencies.createKubectl(this.version));\n await this.kubeCtl.ensureKubectl();\n return this.kubeCtl;\n }\n /**\n * @internal\n */\n async reconnect() {\n var _a;\n this.dependencies.logger.info(`[CLUSTER]: reconnect`, this.getMeta());\n await ((_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.restartServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n if (this.disconnected) {\n return void this.dependencies.logger.debug(\"[CLUSTER]: already disconnected\", { id: this.id });\n }\n this.dependencies.logger.info(`[CLUSTER]: disconnecting`, { id: this.id });\n this.eventsDisposer();\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n this.disconnected = true;\n this.online = false;\n this.accessible = false;\n this.ready = false;\n this.activated = false;\n this.allowedNamespaces = [];\n this.resourceAccessStatuses.clear();\n this.pushState();\n this.dependencies.logger.info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n * @param opts refresh options\n */\n async refresh(opts = {}) {\n this.dependencies.logger.info(`[CLUSTER]: refresh`, this.getMeta());\n await this.refreshConnectionStatus();\n if (this.accessible) {\n await this.refreshAccessibility();\n if (opts.refreshMetadata) {\n this.refreshMetadata();\n }\n }\n this.pushState();\n }\n /**\n * @internal\n */\n async refreshMetadata() {\n this.dependencies.logger.info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const metadata = await this.dependencies.detectorRegistry.detectForCluster(this);\n const existingMetadata = this.metadata;\n this.metadata = Object.assign(existingMetadata, metadata);\n }\n /**\n * @internal\n */\n async refreshAccessibility() {\n const proxyConfig = await this.getProxyKubeconfig();\n const canI = this.dependencies.createAuthorizationReview(proxyConfig);\n this.isAdmin = await canI({\n namespace: \"kube-system\",\n resource: \"*\",\n verb: \"create\",\n });\n this.isGlobalWatchEnabled = await canI({\n verb: \"watch\",\n resource: \"*\",\n });\n this.allowedNamespaces = await this.getAllowedNamespaces(proxyConfig);\n this.allowedResources = await this.getAllowedResources(canI);\n this.ready = true;\n }\n /**\n * @internal\n */\n async refreshConnectionStatus() {\n const connectionStatus = await this.getConnectionStatus();\n this.online = connectionStatus > _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await this.dependencies.loadConfigfromFile(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await this.dependencies.loadConfigfromFile(proxyKCPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfigPath() {\n return this.proxyKubeconfigManager.getPath();\n }\n async getConnectionStatus() {\n try {\n const versionDetector = this.dependencies.createVersionDetector(this);\n const versionData = await versionDetector.detect();\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${error}`);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isRequestError)(error)) {\n if (error.statusCode) {\n if (error.statusCode >= 400 && error.statusCode < 500) {\n this.broadcastConnectUpdate(\"Invalid credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n if (error.failed === true) {\n if (error.timedOut === true) {\n this.broadcastConnectUpdate(\"Connection timed out\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n }\n else {\n this.broadcastConnectUpdate(\"Unknown error has occurred\", true);\n }\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n id: this.id,\n contextName: this.contextName,\n kubeConfigPath: this.kubeConfigPath,\n workspace: this.workspace,\n workspaces: this.workspaces,\n preferences: this.preferences,\n metadata: this.metadata,\n accessibleNamespaces: this.accessibleNamespaces,\n labels: this.labels,\n });\n }\n /**\n * Serializable cluster-state used for sync btw main <-> renderer\n */\n getState() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n apiUrl: this.apiUrl,\n online: this.online,\n ready: this.ready,\n disconnected: this.disconnected,\n accessible: this.accessible,\n isAdmin: this.isAdmin,\n allowedNamespaces: this.allowedNamespaces,\n allowedResources: this.allowedResources,\n isGlobalWatchEnabled: this.isGlobalWatchEnabled,\n });\n }\n /**\n * @internal\n * @param state cluster state\n */\n setState(state) {\n Object.assign(this, state);\n }\n /**\n * @internal\n * @param state cluster state\n */\n pushState(state = this.getState()) {\n this.dependencies.logger.silly(`[CLUSTER]: push-state`, state);\n this.dependencies.broadcastMessage(\"cluster:state\", this.id, state);\n }\n // get cluster system meta, e.g. use in \"logger\"\n getMeta() {\n return {\n id: this.id,\n name: this.contextName,\n ready: this.ready,\n online: this.online,\n accessible: this.accessible,\n disconnected: this.disconnected,\n };\n }\n /**\n * broadcast an authentication update concerning this cluster\n * @internal\n */\n broadcastConnectUpdate(message, isError = false) {\n const update = { message, isError };\n this.dependencies.logger.debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n this.dependencies.broadcastMessage(`cluster:${this.id}:connection-update`, update);\n }\n async getAllowedNamespaces(proxyConfig) {\n if (this.accessibleNamespaces.length) {\n return this.accessibleNamespaces;\n }\n try {\n const listNamespaces = this.dependencies.createListNamespaces(proxyConfig);\n return await listNamespaces();\n }\n catch (error) {\n const ctx = proxyConfig.getContextObject(this.contextName);\n const namespaceList = [ctx === null || ctx === void 0 ? void 0 : ctx.namespace].filter(_utils__WEBPACK_IMPORTED_MODULE_4__.isDefined);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__.HttpError && error.statusCode === 403) {\n const { response } = error;\n this.dependencies.logger.info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n this.dependencies.broadcastMessage(_ipc_cluster__WEBPACK_IMPORTED_MODULE_5__.clusterListNamespaceForbiddenChannel, this.id);\n }\n return namespaceList;\n }\n }\n async getAllowedResources(canI) {\n try {\n if (!this.allowedNamespaces.length) {\n return [];\n }\n const resources = _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.filter((resource) => this.resourceAccessStatuses.get(resource) === undefined);\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_2___default()(5); // 5 concurrent api requests\n const requests = [];\n for (const apiResource of resources) {\n requests.push(apiLimit(async () => {\n for (const namespace of this.allowedNamespaces.slice(0, 10)) {\n if (!this.resourceAccessStatuses.get(apiResource)) {\n const result = await canI({\n resource: apiResource.apiName,\n group: apiResource.group,\n verb: \"list\",\n namespace,\n });\n this.resourceAccessStatuses.set(apiResource, result);\n }\n }\n }));\n }\n await Promise.all(requests);\n return _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.filter((resource) => this.resourceAccessStatuses.get(resource))\n .map(apiResource => apiResource.apiName);\n }\n catch (error) {\n return [];\n }\n }\n isAllowedResource(kind) {\n if (kind in _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResourceRecord) {\n return this.allowedResources.includes(kind);\n }\n const apiResource = _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.find(resource => resource.kind === kind);\n if (apiResource) {\n return this.allowedResources.includes(apiResource.apiName);\n }\n return true; // allowed by default for other resources\n }\n isMetricHidden(resource) {\n var _a;\n return Boolean((_a = this.preferences.hiddenMetrics) === null || _a === void 0 ? void 0 : _a.includes(resource));\n }\n get nodeShellImage() {\n var _a;\n return ((_a = this.preferences) === null || _a === void 0 ? void 0 : _a.nodeShellImage) || _cluster_types__WEBPACK_IMPORTED_MODULE_3__.initialNodeShellImage;\n }\n get imagePullSecret() {\n var _a;\n return (_a = this.preferences) === null || _a === void 0 ? void 0 : _a.imagePullSecret;\n }\n isInLocalKubeconfig() {\n return this.kubeConfigPath.startsWith(this.dependencies.directoryForKubeConfigs);\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedResources\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"accessibleNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"updateModel\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"activate\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"reconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"disconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refresh\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshConnectionStatus\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"setState\", null);\n\n\n//# sourceURL=webpack://open-lens/./src/common/cluster/cluster.ts?");
|
29815
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Cluster\": () => (/* binding */ Cluster)\n/* harmony export */ });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! assert */ \"assert\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(assert__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n get contextHandler() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._contextHandler, \"contextHandler is only defined in the main environment\");\n return this._contextHandler;\n }\n get proxyKubeconfigManager() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._proxyKubeconfigManager, \"proxyKubeconfigManager is only defined in the main environment\");\n return this._proxyKubeconfigManager;\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_7__.when)(() => this.ready);\n }\n /**\n * Is cluster available\n *\n * @computed\n */\n get available() {\n return this.accessible && !this.disconnected;\n }\n /**\n * Cluster name\n *\n * @computed\n */\n get name() {\n return this.preferences.clusterName || this.contextName;\n }\n /**\n * The detected kubernetes distribution\n */\n get distribution() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.DISTRIBUTION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * The detected kubernetes version\n */\n get version() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.VERSION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * Prometheus preferences\n *\n * @computed\n * @internal\n */\n get prometheusPreferences() {\n const { prometheus, prometheusProvider } = this.preferences;\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\n }\n constructor(dependencies, { id, ...model }, configData) {\n Object.defineProperty(this, \"dependencies\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: dependencies\n });\n /** Unique id for a cluster */\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"kubeCtl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Context handler\n *\n * @internal\n */\n Object.defineProperty(this, \"_contextHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_proxyKubeconfigManager\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventsDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.disposer)()\n });\n Object.defineProperty(this, \"activated\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"resourceAccessStatuses\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: new Map()\n });\n /**\n * Kubeconfig context name\n *\n * @observable\n */\n Object.defineProperty(this, \"contextName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Path to kubeconfig\n *\n * @observable\n */\n Object.defineProperty(this, \"kubeConfigPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspace\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Kubernetes API server URL\n *\n * @observable\n */\n Object.defineProperty(this, \"apiUrl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n }); // cluster server url\n /**\n * Is cluster online\n *\n * @observable\n */\n Object.defineProperty(this, \"online\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // describes if we can detect that cluster is online\n /**\n * Can user access cluster resources\n *\n * @observable\n */\n Object.defineProperty(this, \"accessible\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // if user is able to access cluster resources\n /**\n * Is cluster instance in usable state\n *\n * @observable\n */\n Object.defineProperty(this, \"ready\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // cluster is in usable state\n /**\n * Is cluster currently reconnecting\n *\n * @observable\n */\n Object.defineProperty(this, \"reconnecting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Is cluster disconnected. False if user has selected to connect.\n *\n * @observable\n */\n Object.defineProperty(this, \"disconnected\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n });\n /**\n * Does user have admin like access\n *\n * @observable\n */\n Object.defineProperty(this, \"isAdmin\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Global watch-api accessibility , e.g. \"/api/v1/services?watch=1\"\n *\n * @observable\n */\n Object.defineProperty(this, \"isGlobalWatchEnabled\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Preferences\n *\n * @observable\n */\n Object.defineProperty(this, \"preferences\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * Metadata\n *\n * @observable\n */\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * List of allowed namespaces verified via K8S::SelfSubjectAccessReview api\n *\n * @observable\n */\n Object.defineProperty(this, \"allowedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * List of allowed resources\n *\n * @observable\n * @internal\n */\n Object.defineProperty(this, \"allowedResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * List of accessible namespaces provided by user in the Cluster Settings\n *\n * @observable\n */\n Object.defineProperty(this, \"accessibleNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: []\n });\n /**\n * Labels for the catalog entity\n */\n Object.defineProperty(this, \"labels\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n (0,mobx__WEBPACK_IMPORTED_MODULE_7__.makeObservable)(this);\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.clusterModelIdChecker.validate({ id });\n if (error) {\n throw error;\n }\n this.id = id;\n this.updateModel(model);\n this.apiUrl = configData.clusterServerUrl;\n // for the time being, until renderer gets its own cluster type\n this._contextHandler = this.dependencies.createContextHandler(this);\n this._proxyKubeconfigManager = this.dependencies.createKubeconfigManager(this);\n this.dependencies.logger.debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n /**\n * Update cluster data model\n *\n * @param model\n */\n updateModel(model) {\n // Note: do not assign ID as that should never be updated\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.updateClusterModelChecker.validate(model, { allowUnknown: true });\n if (error) {\n throw error;\n }\n this.kubeConfigPath = model.kubeConfigPath;\n this.contextName = model.contextName;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.preferences) {\n this.preferences = model.preferences;\n }\n if (model.metadata) {\n this.metadata = model.metadata;\n }\n if (model.accessibleNamespaces) {\n this.accessibleNamespaces = model.accessibleNamespaces;\n }\n if (model.labels) {\n this.labels = model.labels;\n }\n }\n /**\n * @internal\n */\n bindEvents() {\n this.dependencies.logger.info(`[CLUSTER]: bind events`, this.getMeta());\n const refreshTimer = setInterval(() => !this.disconnected && this.refresh(), 30000); // every 30s\n const refreshMetadataTimer = setInterval(() => this.available && this.refreshAccessibilityAndMetadata(), 900000); // every 15 minutes\n this.eventsDisposer.push((0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.getState(), state => this.pushState(state)), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_7__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n this.dependencies.logger.info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: failed to recreate proxy kubeconfig`, error);\n }\n }\n /**\n * @param force force activation\n * @internal\n */\n async activate(force = false) {\n if (this.activated && !force) {\n return this.pushState();\n }\n this.dependencies.logger.info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Starting connection ...\");\n await this.reconnect();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to start connection: ${error}`, true);\n return;\n }\n }\n try {\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to connection status: ${error}`, true);\n return;\n }\n if (this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to refresh accessibility: ${error}`, true);\n return;\n }\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => this.dependencies.logger.warn(`[CLUSTER]: failed to download kubectl for clusterId=${this.id}`, error));\n this.broadcastConnectUpdate(\"Connected, waiting for view to load ...\");\n }\n this.activated = true;\n this.pushState();\n }\n /**\n * @internal\n */\n async ensureKubectl() {\n var _a;\n (_a = this.kubeCtl) !== null && _a !== void 0 ? _a : (this.kubeCtl = this.dependencies.createKubectl(this.version));\n await this.kubeCtl.ensureKubectl();\n return this.kubeCtl;\n }\n /**\n * @internal\n */\n async reconnect() {\n var _a;\n this.dependencies.logger.info(`[CLUSTER]: reconnect`, this.getMeta());\n await ((_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.restartServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n if (this.disconnected) {\n return void this.dependencies.logger.debug(\"[CLUSTER]: already disconnected\", { id: this.id });\n }\n this.dependencies.logger.info(`[CLUSTER]: disconnecting`, { id: this.id });\n this.eventsDisposer();\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n this.disconnected = true;\n this.online = false;\n this.accessible = false;\n this.ready = false;\n this.activated = false;\n this.allowedNamespaces = [];\n this.resourceAccessStatuses.clear();\n this.pushState();\n this.dependencies.logger.info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n */\n async refresh() {\n this.dependencies.logger.info(`[CLUSTER]: refresh`, this.getMeta());\n await this.refreshConnectionStatus();\n this.pushState();\n }\n /**\n * @internal\n */\n async refreshAccessibilityAndMetadata() {\n await this.refreshAccessibility();\n await this.refreshMetadata();\n }\n /**\n * @internal\n */\n async refreshMetadata() {\n this.dependencies.logger.info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const metadata = await this.dependencies.detectorRegistry.detectForCluster(this);\n const existingMetadata = this.metadata;\n this.metadata = Object.assign(existingMetadata, metadata);\n }\n /**\n * @internal\n */\n async refreshAccessibility() {\n this.dependencies.logger.info(`[CLUSTER]: refreshAccessibility`, this.getMeta());\n const proxyConfig = await this.getProxyKubeconfig();\n const canI = this.dependencies.createAuthorizationReview(proxyConfig);\n const requestNamespaceResources = this.dependencies.createAuthorizationNamespaceReview(proxyConfig);\n const listApiResources = this.dependencies.createListApiResources(this);\n this.isAdmin = await canI({\n namespace: \"kube-system\",\n resource: \"*\",\n verb: \"create\",\n });\n this.isGlobalWatchEnabled = await canI({\n verb: \"watch\",\n resource: \"*\",\n });\n this.allowedNamespaces = await this.getAllowedNamespaces(proxyConfig);\n this.allowedResources = await this.getAllowedResources(listApiResources, requestNamespaceResources);\n this.ready = true;\n }\n /**\n * @internal\n */\n async refreshConnectionStatus() {\n const connectionStatus = await this.getConnectionStatus();\n this.online = connectionStatus > _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await this.dependencies.loadConfigfromFile(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await this.dependencies.loadConfigfromFile(proxyKCPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfigPath() {\n return this.proxyKubeconfigManager.getPath();\n }\n async getConnectionStatus() {\n try {\n const versionDetector = this.dependencies.createVersionDetector(this);\n const versionData = await versionDetector.detect();\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${error}`);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isRequestError)(error)) {\n if (error.statusCode) {\n if (error.statusCode >= 400 && error.statusCode < 500) {\n this.broadcastConnectUpdate(\"Invalid credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n if (error.failed === true) {\n if (error.timedOut === true) {\n this.broadcastConnectUpdate(\"Connection timed out\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n }\n else {\n this.broadcastConnectUpdate(\"Unknown error has occurred\", true);\n }\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n id: this.id,\n contextName: this.contextName,\n kubeConfigPath: this.kubeConfigPath,\n workspace: this.workspace,\n workspaces: this.workspaces,\n preferences: this.preferences,\n metadata: this.metadata,\n accessibleNamespaces: this.accessibleNamespaces,\n labels: this.labels,\n });\n }\n /**\n * Serializable cluster-state used for sync btw main <-> renderer\n */\n getState() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n apiUrl: this.apiUrl,\n online: this.online,\n ready: this.ready,\n disconnected: this.disconnected,\n accessible: this.accessible,\n isAdmin: this.isAdmin,\n allowedNamespaces: this.allowedNamespaces,\n allowedResources: this.allowedResources,\n isGlobalWatchEnabled: this.isGlobalWatchEnabled,\n });\n }\n /**\n * @internal\n * @param state cluster state\n */\n setState(state) {\n Object.assign(this, state);\n }\n /**\n * @internal\n * @param state cluster state\n */\n pushState(state = this.getState()) {\n this.dependencies.logger.silly(`[CLUSTER]: push-state`, state);\n this.dependencies.broadcastMessage(\"cluster:state\", this.id, state);\n }\n // get cluster system meta, e.g. use in \"logger\"\n getMeta() {\n return {\n id: this.id,\n name: this.contextName,\n ready: this.ready,\n online: this.online,\n accessible: this.accessible,\n disconnected: this.disconnected,\n };\n }\n /**\n * broadcast an authentication update concerning this cluster\n * @internal\n */\n broadcastConnectUpdate(message, isError = false) {\n const update = { message, isError };\n this.dependencies.logger.debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n this.dependencies.broadcastMessage(`cluster:${this.id}:connection-update`, update);\n }\n async getAllowedNamespaces(proxyConfig) {\n if (this.accessibleNamespaces.length) {\n return this.accessibleNamespaces;\n }\n try {\n const listNamespaces = this.dependencies.createListNamespaces(proxyConfig);\n return await listNamespaces();\n }\n catch (error) {\n const ctx = proxyConfig.getContextObject(this.contextName);\n const namespaceList = [ctx === null || ctx === void 0 ? void 0 : ctx.namespace].filter(_utils__WEBPACK_IMPORTED_MODULE_4__.isDefined);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__.HttpError && error.statusCode === 403) {\n const { response } = error;\n this.dependencies.logger.info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n this.dependencies.broadcastMessage(_ipc_cluster__WEBPACK_IMPORTED_MODULE_5__.clusterListNamespaceForbiddenChannel, this.id);\n }\n return namespaceList;\n }\n }\n async getAllowedResources(listApiResources, requestNamespaceResources) {\n try {\n if (!this.allowedNamespaces.length) {\n return [];\n }\n const unknownResources = new Map(_rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.map(resource => ([resource.apiName, resource])));\n const availableResources = await listApiResources();\n const availableResourcesNames = new Set(availableResources.map(apiResource => apiResource.apiName));\n [...unknownResources.values()].map(unknownResource => {\n if (!availableResourcesNames.has(unknownResource.apiName)) {\n this.resourceAccessStatuses.set(unknownResource, false);\n unknownResources.delete(unknownResource.apiName);\n }\n });\n if (unknownResources.size > 0) {\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_2___default()(5); // 5 concurrent api requests\n await Promise.all(this.allowedNamespaces.map(namespace => apiLimit(async () => {\n if (unknownResources.size === 0) {\n return;\n }\n const namespaceResources = await requestNamespaceResources(namespace, availableResources);\n for (const resourceName of namespaceResources) {\n const unknownResource = unknownResources.get(resourceName);\n if (unknownResource) {\n this.resourceAccessStatuses.set(unknownResource, true);\n unknownResources.delete(resourceName);\n }\n }\n })));\n for (const forbiddenResource of unknownResources.values()) {\n this.resourceAccessStatuses.set(forbiddenResource, false);\n }\n }\n return _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.filter((resource) => this.resourceAccessStatuses.get(resource))\n .map(apiResource => apiResource.apiName);\n }\n catch (error) {\n return [];\n }\n }\n isAllowedResource(kind) {\n if (kind in _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResourceRecord) {\n return this.allowedResources.includes(kind);\n }\n const apiResource = _rbac__WEBPACK_IMPORTED_MODULE_1__.apiResources.find(resource => resource.kind === kind);\n if (apiResource) {\n return this.allowedResources.includes(apiResource.apiName);\n }\n return true; // allowed by default for other resources\n }\n isMetricHidden(resource) {\n var _a;\n return Boolean((_a = this.preferences.hiddenMetrics) === null || _a === void 0 ? void 0 : _a.includes(resource));\n }\n get nodeShellImage() {\n var _a;\n return ((_a = this.preferences) === null || _a === void 0 ? void 0 : _a.nodeShellImage) || _cluster_types__WEBPACK_IMPORTED_MODULE_3__.initialNodeShellImage;\n }\n get imagePullSecret() {\n var _a;\n return (_a = this.preferences) === null || _a === void 0 ? void 0 : _a.imagePullSecret;\n }\n isInLocalKubeconfig() {\n return this.kubeConfigPath.startsWith(this.dependencies.directoryForKubeConfigs);\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedResources\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"accessibleNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"updateModel\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"activate\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"reconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"disconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refresh\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshAccessibilityAndMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshConnectionStatus\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"setState\", null);\n\n\n//# sourceURL=webpack://open-lens/./src/common/cluster/cluster.ts?");
|
29816
29816
|
|
29817
29817
|
/***/ }),
|
29818
29818
|
|
@@ -29944,7 +29944,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
29944
29944
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
29945
29945
|
|
29946
29946
|
"use strict";
|
29947
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ogre-tools/injectable */ \"./node_modules/@ogre-tools/injectable/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! child_process */ \"child_process\");\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\n\n\nconst execFileInjectable = (0,_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__.getInjectable)({\n id: \"exec-file\",\n instantiate: () => (filePath,
|
29947
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ogre-tools/injectable */ \"./node_modules/@ogre-tools/injectable/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! child_process */ \"child_process\");\n/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\n\n\nconst execFileInjectable = (0,_ogre_tools_injectable__WEBPACK_IMPORTED_MODULE_0__.getInjectable)({\n id: \"exec-file\",\n instantiate: () => {\n return (filePath, argsOrOptions, maybeOptions) => {\n const { args, options } = (() => {\n if (Array.isArray(argsOrOptions)) {\n return {\n args: argsOrOptions,\n options: maybeOptions !== null && maybeOptions !== void 0 ? maybeOptions : {},\n };\n }\n else {\n return {\n args: [],\n options: argsOrOptions !== null && argsOrOptions !== void 0 ? argsOrOptions : {},\n };\n }\n })();\n return new Promise((resolve) => {\n (0,child_process__WEBPACK_IMPORTED_MODULE_1__.execFile)(filePath, args, options, (error, stdout, stderr) => {\n if (error) {\n resolve({\n callWasSuccessful: false,\n error: Object.assign(error, { stderr }),\n });\n }\n else {\n resolve({\n callWasSuccessful: true,\n response: stdout,\n });\n }\n });\n });\n };\n },\n causesSideEffects: true,\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (execFileInjectable);\n\n\n//# sourceURL=webpack://open-lens/./src/common/fs/exec-file.injectable.ts?");
|
29948
29948
|
|
29949
29949
|
/***/ }),
|
29950
29950
|
|
@@ -30043,7 +30043,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
30043
30043
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
30044
30044
|
|
30045
30045
|
"use strict";
|
30046
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"clusterActivateHandler\": () => (/* binding */ clusterActivateHandler),\n/* harmony export */ \"clusterDisconnectHandler\": () => (/* binding */ clusterDisconnectHandler),\n/* harmony export */ \"clusterKubectlApplyAllHandler\": () => (/* binding */ clusterKubectlApplyAllHandler),\n/* harmony export */ \"clusterKubectlDeleteAllHandler\": () => (/* binding */ clusterKubectlDeleteAllHandler),\n/* harmony export */ \"clusterListNamespaceForbiddenChannel\": () => (/* binding */ clusterListNamespaceForbiddenChannel),\n/* harmony export */ \"
|
30046
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"clusterActivateHandler\": () => (/* binding */ clusterActivateHandler),\n/* harmony export */ \"clusterDisconnectHandler\": () => (/* binding */ clusterDisconnectHandler),\n/* harmony export */ \"clusterKubectlApplyAllHandler\": () => (/* binding */ clusterKubectlApplyAllHandler),\n/* harmony export */ \"clusterKubectlDeleteAllHandler\": () => (/* binding */ clusterKubectlDeleteAllHandler),\n/* harmony export */ \"clusterListNamespaceForbiddenChannel\": () => (/* binding */ clusterListNamespaceForbiddenChannel),\n/* harmony export */ \"clusterSetFrameIdHandler\": () => (/* binding */ clusterSetFrameIdHandler),\n/* harmony export */ \"clusterStates\": () => (/* binding */ clusterStates),\n/* harmony export */ \"clusterVisibilityHandler\": () => (/* binding */ clusterVisibilityHandler),\n/* harmony export */ \"isListNamespaceForbiddenArgs\": () => (/* binding */ isListNamespaceForbiddenArgs)\n/* harmony export */ });\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\nconst clusterActivateHandler = \"cluster:activate\";\nconst clusterSetFrameIdHandler = \"cluster:set-frame-id\";\nconst clusterVisibilityHandler = \"cluster:visibility\";\nconst clusterDisconnectHandler = \"cluster:disconnect\";\nconst clusterKubectlApplyAllHandler = \"cluster:kubectl-apply-all\";\nconst clusterKubectlDeleteAllHandler = \"cluster:kubectl-delete-all\";\nconst clusterStates = \"cluster:states\";\n/**\n * This channel is broadcast on whenever the cluster fails to list namespaces\n * during a refresh and no `accessibleNamespaces` have been set.\n */\nconst clusterListNamespaceForbiddenChannel = \"cluster:list-namespace-forbidden\";\nfunction isListNamespaceForbiddenArgs(args) {\n return args.length === 1 && typeof args[0] === \"string\";\n}\n\n\n//# sourceURL=webpack://open-lens/./src/common/ipc/cluster.ts?");
|
30047
30047
|
|
30048
30048
|
/***/ }),
|
30049
30049
|
|
@@ -40823,7 +40823,7 @@ eval("module.exports = JSON.parse('{\"name\":\"winston\",\"description\":\"A log
|
|
40823
40823
|
/***/ ((module) => {
|
40824
40824
|
|
40825
40825
|
"use strict";
|
40826
|
-
eval("module.exports = JSON.parse('{\"name\":\"open-lens\",\"productName\":\"OpenLens\",\"description\":\"OpenLens - Open Source IDE for Kubernetes\",\"homepage\":\"https://github.com/lensapp/lens\",\"version\":\"6.3.0-alpha.0\",\"main\":\"static/build/main.js\",\"copyright\":\"© 2022 OpenLens Authors\",\"license\":\"MIT\",\"author\":{\"name\":\"OpenLens Authors\",\"email\":\"info@k8slens.dev\"},\"scripts\":{\"adr:create\":\"echo \\\\\"What is the title?\\\\\"; read title; adr new \\\\\"$title\\\\\"\",\"adr:change-status\":\"echo \\\\\"Decision number?:\\\\\"; read decision; adr status $decision\",\"adr:update-readme\":\"adr update\",\"adr:list\":\"adr list\",\"dev\":\"concurrently -i -k \\\\\"yarn run dev-run -C\\\\\" yarn:dev:*\",\"dev-build\":\"concurrently yarn:compile:*\",\"debug-build\":\"concurrently yarn:compile:main yarn:compile:extension-types\",\"dev-run\":\"nodemon --watch ./static/build/main.js --exec \\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\"\",\"dev:main\":\"yarn run compile:main --watch --progress\",\"dev:renderer\":\"yarn run ts-node webpack/dev-server.ts\",\"compile\":\"env NODE_ENV=production concurrently yarn:compile:*\",\"compile:main\":\"yarn run webpack --config webpack/main.ts\",\"compile:renderer\":\"yarn run webpack --config webpack/renderer.ts\",\"compile:extension-types\":\"yarn run webpack --config webpack/extensions.ts\",\"compile:node-fetch\":\"yarn run webpack --config ./webpack/node-fetch.ts\",\"postinstall\":\"yarn run compile:node-fetch\",\"npm:fix-package-version\":\"yarn run ts-node build/set_npm_version.ts\",\"build:linux\":\"yarn run compile && electron-builder --linux --dir\",\"build:mac\":\"yarn run compile && electron-builder --mac --dir\",\"build:win\":\"yarn run compile && electron-builder --win --dir\",\"integration\":\"jest --runInBand --detectOpenHandles --forceExit integration\",\"test:unit\":\"func() { jest ${1} --watch --testPathIgnorePatterns integration; }; func\",\"test:integration\":\"func() { jest ${1:-xyz} --watch --runInBand --detectOpenHandles --forceExit --modulePaths=[\\\\\"<rootDir>/integration/\\\\\"]; }; func\",\"dist\":\"yarn run compile && electron-builder --publish onTag\",\"dist:dir\":\"yarn run dist --dir -c.compression=store -c.mac.identity=null\",\"download:binaries\":\"yarn run ts-node build/download_binaries.ts\",\"build:tray-icons\":\"yarn run ts-node build/generate-tray-icons.ts\",\"build:theme-vars\":\"yarn run ts-node build/build_theme_vars.ts\",\"lint\":\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\",\"lint:fix\":\"yarn run lint --fix\",\"mkdocs-serve-local\":\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\",\"verify-docs\":\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\",\"typedocs-extensions-api\":\"yarn run typedoc src/extensions/extension-api.ts\",\"version-checkout\":\"cat package.json | jq \\'.version\\' -r | xargs printf \\\\\"release/v%s\\\\\" | xargs git checkout -b\",\"version-commit\":\"cat package.json | jq \\'.version\\' -r | xargs printf \\\\\"release v%s\\\\\" | git commit --no-edit -s -F -\",\"version\":\"yarn run version-checkout && git add package.json && yarn run version-commit\",\"postversion\":\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\",\"precreate-release-pr\":\"npx swc ./scripts/create-release-pr.ts -o ./scripts/create-release-pr.mjs\",\"create-release-pr\":\"node ./scripts/create-release-pr.mjs\"},\"config\":{\"k8sProxyVersion\":\"0.3.0\",\"bundledKubectlVersion\":\"1.23.3\",\"bundledHelmVersion\":\"3.7.2\",\"sentryDsn\":\"\",\"contentSecurityPolicy\":\"script-src \\'unsafe-eval\\' \\'self\\'; frame-src http://*.localhost:*/; img-src * data:\",\"welcomeRoute\":\"/welcome\"},\"engines\":{\"node\":\">=16 <17\"},\"jest\":{\"collectCoverage\":false,\"verbose\":true,\"transform\":{\"^.+\\\\\\\\.(t|j)sx?$\":[\"@swc/jest\"]},\"testEnvironment\":\"jsdom\",\"resolver\":\"<rootDir>/src/jest-28-resolver.js\",\"moduleNameMapper\":{\"\\\\\\\\.(css|scss)$\":\"identity-obj-proxy\",\"\\\\\\\\.(svg|png|jpg|eot|woff2?|ttf)$\":\"<rootDir>/__mocks__/assetMock.ts\"},\"modulePathIgnorePatterns\":[\"<rootDir>/dist\",\"<rootDir>/src/extensions/npm\"],\"setupFiles\":[\"<rootDir>/src/jest.setup.ts\",\"jest-canvas-mock\"],\"globalSetup\":\"<rootDir>/src/jest.timezone.ts\",\"setupFilesAfterEnv\":[\"<rootDir>/src/jest-after-env.setup.ts\"],\"runtime\":\"@side/jest-runtime\"},\"build\":{\"generateUpdatesFilesForAllChannels\":true,\"files\":[\"static/build/main.js\"],\"afterSign\":\"build/notarize.js\",\"extraResources\":[{\"from\":\"locales/\",\"to\":\"locales/\",\"filter\":\"**/*.js\"},{\"from\":\"static/\",\"to\":\"static/\",\"filter\":\"!**/main.js\"},{\"from\":\"build/tray\",\"to\":\"static/icons\",\"filter\":\"*.png\"},{\"from\":\"extensions/\",\"to\":\"./extensions/\",\"filter\":[\"**/*.tgz\",\"**/package.json\",\"!**/node_modules\"]},{\"from\":\"templates/\",\"to\":\"./templates/\",\"filter\":\"**/*.yaml\"},\"LICENSE\"],\"linux\":{\"category\":\"Network\",\"artifactName\":\"${productName}-${version}.${arch}.${ext}\",\"target\":[\"deb\",\"rpm\",\"AppImage\"],\"extraResources\":[{\"from\":\"binaries/client/linux/${arch}/kubectl\",\"to\":\"./${arch}/kubectl\"},{\"from\":\"binaries/client/linux/${arch}/lens-k8s-proxy\",\"to\":\"./${arch}/lens-k8s-proxy\"},{\"from\":\"binaries/client/linux/${arch}/helm\",\"to\":\"./${arch}/helm\"}]},\"rpm\":{\"fpm\":[\"--rpm-rpmbuild-define=%define _build_id_links none\"]},\"mac\":{\"hardenedRuntime\":true,\"gatekeeperAssess\":false,\"entitlements\":\"build/entitlements.mac.plist\",\"entitlementsInherit\":\"build/entitlements.mac.plist\",\"extraResources\":[{\"from\":\"binaries/client/darwin/${arch}/kubectl\",\"to\":\"./${arch}/kubectl\"},{\"from\":\"binaries/client/darwin/${arch}/lens-k8s-proxy\",\"to\":\"./${arch}/lens-k8s-proxy\"},{\"from\":\"binaries/client/darwin/${arch}/helm\",\"to\":\"./${arch}/helm\"}]},\"win\":{\"target\":[\"nsis\"],\"extraResources\":[{\"from\":\"binaries/client/windows/${arch}/kubectl.exe\",\"to\":\"./${arch}/kubectl.exe\"},{\"from\":\"binaries/client/windows/${arch}/lens-k8s-proxy.exe\",\"to\":\"./${arch}/lens-k8s-proxy.exe\"},{\"from\":\"binaries/client/windows/${arch}/helm.exe\",\"to\":\"./${arch}/helm.exe\"}]},\"nsis\":{\"include\":\"build/installer.nsh\",\"oneClick\":false,\"allowElevation\":true,\"createStartMenuShortcut\":true,\"allowToChangeInstallationDirectory\":true},\"protocols\":{\"name\":\"Lens Protocol Handler\",\"schemes\":[\"lens\"],\"role\":\"Viewer\"}},\"resolutions\":{\"@astronautlabs/jsonpath/underscore\":\"^1.12.1\"},\"dependencies\":{\"@astronautlabs/jsonpath\":\"^1.1.0\",\"@hapi/call\":\"^9.0.0\",\"@hapi/subtext\":\"^7.0.4\",\"@kubernetes/client-node\":\"^0.17.1\",\"@material-ui/styles\":\"^4.11.5\",\"@ogre-tools/fp\":\"^12.0.1\",\"@ogre-tools/injectable\":\"^12.0.1\",\"@ogre-tools/injectable-extension-for-auto-registration\":\"^12.0.1\",\"@ogre-tools/injectable-extension-for-mobx\":\"^12.0.1\",\"@ogre-tools/injectable-react\":\"^12.0.1\",\"@sentry/electron\":\"^3.0.8\",\"@sentry/integrations\":\"^6.19.3\",\"@side/jest-runtime\":\"^1.0.1\",\"@types/circular-dependency-plugin\":\"5.0.5\",\"abort-controller\":\"^3.0.0\",\"auto-bind\":\"^4.0.0\",\"await-lock\":\"^2.2.2\",\"byline\":\"^5.0.0\",\"chokidar\":\"^3.5.3\",\"conf\":\"^7.1.2\",\"crypto-js\":\"^4.1.1\",\"electron-devtools-installer\":\"^3.2.0\",\"electron-updater\":\"^4.6.5\",\"electron-window-state\":\"^5.0.3\",\"filehound\":\"^1.17.6\",\"fs-extra\":\"^9.0.1\",\"glob-to-regexp\":\"^0.4.1\",\"got\":\"^11.8.5\",\"grapheme-splitter\":\"^1.0.4\",\"handlebars\":\"^4.7.7\",\"history\":\"^4.10.1\",\"http-proxy\":\"^1.18.1\",\"immer\":\"^9.0.16\",\"joi\":\"^17.7.0\",\"js-yaml\":\"^4.1.0\",\"jsdom\":\"^16.7.0\",\"lodash\":\"^4.17.15\",\"mac-ca\":\"^1.0.6\",\"marked\":\"^4.2.2\",\"md5-file\":\"^5.0.0\",\"mobx\":\"^6.7.0\",\"mobx-observable-history\":\"^2.0.3\",\"mobx-react\":\"^7.6.0\",\"mobx-utils\":\"^6.0.4\",\"mock-fs\":\"^5.2.0\",\"moment\":\"^2.29.4\",\"moment-timezone\":\"^0.5.39\",\"monaco-editor\":\"^0.29.1\",\"monaco-editor-webpack-plugin\":\"^5.0.0\",\"node-fetch\":\"^3.3.0\",\"node-pty\":\"0.10.1\",\"npm\":\"^8.19.3\",\"p-limit\":\"^3.1.0\",\"path-to-regexp\":\"^6.2.0\",\"proper-lockfile\":\"^4.1.2\",\"react\":\"^17.0.2\",\"react-dom\":\"^17.0.2\",\"react-material-ui-carousel\":\"^2.3.11\",\"react-router\":\"^5.3.4\",\"react-virtualized-auto-sizer\":\"^1.0.7\",\"readable-stream\":\"^3.6.0\",\"request\":\"^2.88.2\",\"request-promise-native\":\"^1.0.9\",\"rfc6902\":\"^4.0.2\",\"selfsigned\":\"^2.1.1\",\"semver\":\"^7.3.8\",\"tar\":\"^6.1.12\",\"tcp-port-used\":\"^1.0.2\",\"tempy\":\"1.0.1\",\"typed-regex\":\"^0.0.8\",\"url-parse\":\"^1.5.10\",\"uuid\":\"^8.3.2\",\"win-ca\":\"^3.5.0\",\"winston\":\"^3.8.2\",\"winston-transport-browserconsole\":\"^1.0.5\",\"ws\":\"^8.11.0\",\"xterm-link-provider\":\"^1.3.1\"},\"devDependencies\":{\"@async-fn/jest\":\"1.6.4\",\"@material-ui/core\":\"^4.12.3\",\"@material-ui/icons\":\"^4.11.2\",\"@material-ui/lab\":\"^4.0.0-alpha.60\",\"@pmmmwh/react-refresh-webpack-plugin\":\"^0.5.9\",\"@sentry/types\":\"^6.19.7\",\"@swc/cli\":\"^0.1.57\",\"@swc/core\":\"^1.3.18\",\"@swc/jest\":\"^0.2.23\",\"@testing-library/dom\":\"^7.31.2\",\"@testing-library/jest-dom\":\"^5.16.5\",\"@testing-library/react\":\"^12.1.5\",\"@testing-library/user-event\":\"^13.5.0\",\"@types/byline\":\"^4.2.33\",\"@types/chart.js\":\"^2.9.36\",\"@types/circular-dependency-plugin\":\"5.0.5\",\"@types/cli-progress\":\"^3.11.0\",\"@types/color\":\"^3.0.3\",\"@types/command-line-args\":\"^5.2.0\",\"@types/crypto-js\":\"^3.1.47\",\"@types/dompurify\":\"^2.4.0\",\"@types/electron-devtools-installer\":\"^2.2.1\",\"@types/fs-extra\":\"^9.0.13\",\"@types/glob-to-regexp\":\"^0.4.1\",\"@types/gunzip-maybe\":\"^1.4.0\",\"@types/hapi__call\":\"^9.0.0\",\"@types/hapi__subtext\":\"^7.0.0\",\"@types/html-webpack-plugin\":\"^3.2.6\",\"@types/http-proxy\":\"^1.17.9\",\"@types/jest\":\"^28.1.6\",\"@types/js-yaml\":\"^4.0.5\",\"@types/jsdom\":\"^16.2.14\",\"@types/lodash\":\"^4.14.189\",\"@types/marked\":\"^4.0.7\",\"@types/md5-file\":\"^4.0.2\",\"@types/memorystream\":\"^0.3.0\",\"@types/mini-css-extract-plugin\":\"^2.4.0\",\"@types/mock-fs\":\"^4.13.1\",\"@types/node\":\"^16.18.2\",\"@types/proper-lockfile\":\"^4.1.2\",\"@types/randomcolor\":\"^0.5.6\",\"@types/react\":\"^17.0.45\",\"@types/react-beautiful-dnd\":\"^13.1.2\",\"@types/react-dom\":\"^17.0.16\",\"@types/react-router\":\"^5.1.19\",\"@types/react-router-dom\":\"^5.3.3\",\"@types/react-table\":\"^7.7.12\",\"@types/react-virtualized-auto-sizer\":\"^1.0.1\",\"@types/react-window\":\"^1.8.5\",\"@types/readable-stream\":\"^2.3.13\",\"@types/request\":\"^2.48.7\",\"@types/request-promise-native\":\"^1.0.18\",\"@types/semver\":\"^7.3.13\",\"@types/sharp\":\"^0.31.0\",\"@types/tar\":\"^6.1.3\",\"@types/tar-stream\":\"^2.2.2\",\"@types/tcp-port-used\":\"^1.0.1\",\"@types/tempy\":\"^0.3.0\",\"@types/triple-beam\":\"^1.3.2\",\"@types/url-parse\":\"^1.4.8\",\"@types/uuid\":\"^8.3.4\",\"@types/webpack\":\"^5.28.0\",\"@types/webpack-dev-server\":\"^4.7.2\",\"@types/webpack-env\":\"^1.18.0\",\"@types/webpack-node-externals\":\"^2.5.3\",\"@typescript-eslint/eslint-plugin\":\"^5.43.0\",\"@typescript-eslint/parser\":\"^5.43.0\",\"adr\":\"^1.4.3\",\"ansi_up\":\"^5.1.0\",\"chalk\":\"^4.1.2\",\"chart.js\":\"^2.9.4\",\"circular-dependency-plugin\":\"^5.2.2\",\"cli-progress\":\"^3.11.2\",\"color\":\"^3.2.1\",\"command-line-args\":\"^5.2.1\",\"concurrently\":\"^7.5.0\",\"css-loader\":\"^6.7.2\",\"deepdash\":\"^5.3.9\",\"dompurify\":\"^2.4.1\",\"electron\":\"^19.1.6\",\"electron-builder\":\"^23.6.0\",\"electron-notarize\":\"^0.3.0\",\"esbuild\":\"^0.15.14\",\"esbuild-loader\":\"^2.20.0\",\"eslint\":\"^8.27.0\",\"eslint-plugin-header\":\"^3.1.1\",\"eslint-plugin-import\":\"^2.26.0\",\"eslint-plugin-react\":\"7.31.10\",\"eslint-plugin-react-hooks\":\"^4.6.0\",\"eslint-plugin-unused-imports\":\"^2.0.0\",\"fork-ts-checker-webpack-plugin\":\"^6.5.2\",\"gunzip-maybe\":\"^1.4.2\",\"html-webpack-plugin\":\"^5.5.0\",\"identity-obj-proxy\":\"^3.0.0\",\"ignore-loader\":\"^0.1.2\",\"include-media\":\"^1.4.9\",\"jest\":\"^28.1.3\",\"jest-canvas-mock\":\"^2.3.1\",\"jest-environment-jsdom\":\"^28.1.3\",\"jest-mock-extended\":\"^2.0.9\",\"make-plural\":\"^6.2.2\",\"memorystream\":\"^0.3.1\",\"mini-css-extract-plugin\":\"^2.7.0\",\"mock-http\":\"^1.1.0\",\"node-gyp\":\"^8.3.0\",\"node-loader\":\"^2.0.0\",\"nodemon\":\"^2.0.20\",\"playwright\":\"^1.28.0\",\"postcss\":\"^8.4.19\",\"postcss-loader\":\"^6.2.1\",\"query-string\":\"^7.1.1\",\"randomcolor\":\"^0.6.2\",\"react-beautiful-dnd\":\"^13.1.1\",\"react-refresh\":\"^0.14.0\",\"react-refresh-typescript\":\"^2.0.7\",\"react-router-dom\":\"^5.3.4\",\"react-select\":\"^5.6.1\",\"react-select-event\":\"^5.5.1\",\"react-table\":\"^7.8.0\",\"react-window\":\"^1.8.8\",\"sass\":\"^1.56.1\",\"sass-loader\":\"^12.6.0\",\"sharp\":\"^0.31.2\",\"style-loader\":\"^3.3.1\",\"tailwindcss\":\"^3.2.4\",\"tar-stream\":\"^2.2.0\",\"ts-loader\":\"^9.4.1\",\"ts-node\":\"^10.9.1\",\"type-fest\":\"^2.14.0\",\"typed-emitter\":\"^1.4.0\",\"typedoc\":\"0.23.21\",\"typedoc-plugin-markdown\":\"^3.13.6\",\"typescript\":\"^4.9.3\",\"typescript-plugin-css-modules\":\"^3.4.0\",\"webpack\":\"^5.75.0\",\"webpack-cli\":\"^4.9.2\",\"webpack-dev-server\":\"^4.11.1\",\"webpack-node-externals\":\"^3.0.0\",\"xterm\":\"^4.19.0\",\"xterm-addon-fit\":\"^0.5.0\"}}');\n\n//# sourceURL=webpack://open-lens/./package.json?");
|
40826
|
+
eval("module.exports = JSON.parse('{\"name\":\"open-lens\",\"productName\":\"OpenLens\",\"description\":\"OpenLens - Open Source IDE for Kubernetes\",\"homepage\":\"https://github.com/lensapp/lens\",\"version\":\"6.3.0-alpha.0\",\"main\":\"static/build/main.js\",\"copyright\":\"© 2022 OpenLens Authors\",\"license\":\"MIT\",\"author\":{\"name\":\"OpenLens Authors\",\"email\":\"info@k8slens.dev\"},\"scripts\":{\"adr:create\":\"echo \\\\\"What is the title?\\\\\"; read title; adr new \\\\\"$title\\\\\"\",\"adr:change-status\":\"echo \\\\\"Decision number?:\\\\\"; read decision; adr status $decision\",\"adr:update-readme\":\"adr update\",\"adr:list\":\"adr list\",\"dev\":\"concurrently -i -k \\\\\"yarn run dev-run -C\\\\\" yarn:dev:*\",\"dev-build\":\"concurrently yarn:compile:*\",\"debug-build\":\"concurrently yarn:compile:main yarn:compile:extension-types\",\"dev-run\":\"nodemon --watch ./static/build/main.js --exec \\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\"\",\"dev:main\":\"yarn run compile:main --watch --progress\",\"dev:renderer\":\"yarn run ts-node webpack/dev-server.ts\",\"compile\":\"env NODE_ENV=production concurrently yarn:compile:*\",\"compile:main\":\"yarn run webpack --config webpack/main.ts\",\"compile:renderer\":\"yarn run webpack --config webpack/renderer.ts\",\"compile:extension-types\":\"yarn run webpack --config webpack/extensions.ts\",\"compile:node-fetch\":\"yarn run webpack --config ./webpack/node-fetch.ts\",\"postinstall\":\"yarn run compile:node-fetch\",\"npm:fix-package-version\":\"yarn run ts-node build/set_npm_version.ts\",\"build:linux\":\"yarn run compile && electron-builder --linux --dir\",\"build:mac\":\"yarn run compile && electron-builder --mac --dir\",\"build:win\":\"yarn run compile && electron-builder --win --dir\",\"integration\":\"jest --runInBand --detectOpenHandles --forceExit integration\",\"test:unit\":\"func() { jest ${1} --watch --testPathIgnorePatterns integration; }; func\",\"test:integration\":\"func() { jest ${1:-xyz} --watch --runInBand --detectOpenHandles --forceExit --modulePaths=[\\\\\"<rootDir>/integration/\\\\\"]; }; func\",\"dist\":\"yarn run compile && electron-builder --publish onTag\",\"dist:dir\":\"yarn run dist --dir -c.compression=store -c.mac.identity=null\",\"download:binaries\":\"yarn run ts-node build/download_binaries.ts\",\"build:tray-icons\":\"yarn run ts-node build/generate-tray-icons.ts\",\"build:theme-vars\":\"yarn run ts-node build/build_theme_vars.ts\",\"lint\":\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\",\"lint:fix\":\"yarn run lint --fix\",\"mkdocs-serve-local\":\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\",\"verify-docs\":\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\",\"typedocs-extensions-api\":\"yarn run typedoc src/extensions/extension-api.ts\",\"version-checkout\":\"cat package.json | jq \\'.version\\' -r | xargs printf \\\\\"release/v%s\\\\\" | xargs git checkout -b\",\"version-commit\":\"cat package.json | jq \\'.version\\' -r | xargs printf \\\\\"release v%s\\\\\" | git commit --no-edit -s -F -\",\"version\":\"yarn run version-checkout && git add package.json && yarn run version-commit\",\"postversion\":\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\",\"precreate-release-pr\":\"npx swc ./scripts/create-release-pr.ts -o ./scripts/create-release-pr.mjs\",\"create-release-pr\":\"node ./scripts/create-release-pr.mjs\"},\"config\":{\"k8sProxyVersion\":\"0.3.0\",\"bundledKubectlVersion\":\"1.23.3\",\"bundledHelmVersion\":\"3.7.2\",\"sentryDsn\":\"\",\"contentSecurityPolicy\":\"script-src \\'unsafe-eval\\' \\'self\\'; frame-src http://*.localhost:*/; img-src * data:\",\"welcomeRoute\":\"/welcome\"},\"engines\":{\"node\":\">=16 <17\"},\"jest\":{\"collectCoverage\":false,\"verbose\":true,\"transform\":{\"^.+\\\\\\\\.(t|j)sx?$\":[\"@swc/jest\"]},\"testEnvironment\":\"jsdom\",\"resolver\":\"<rootDir>/src/jest-28-resolver.js\",\"moduleNameMapper\":{\"\\\\\\\\.(css|scss)$\":\"identity-obj-proxy\",\"\\\\\\\\.(svg|png|jpg|eot|woff2?|ttf)$\":\"<rootDir>/__mocks__/assetMock.ts\"},\"modulePathIgnorePatterns\":[\"<rootDir>/dist\",\"<rootDir>/src/extensions/npm\"],\"setupFiles\":[\"<rootDir>/src/jest.setup.ts\",\"jest-canvas-mock\"],\"globalSetup\":\"<rootDir>/src/jest.timezone.ts\",\"setupFilesAfterEnv\":[\"<rootDir>/src/jest-after-env.setup.ts\"],\"runtime\":\"@side/jest-runtime\"},\"build\":{\"generateUpdatesFilesForAllChannels\":true,\"files\":[\"static/build/main.js\"],\"afterSign\":\"build/notarize.js\",\"extraResources\":[{\"from\":\"locales/\",\"to\":\"locales/\",\"filter\":\"**/*.js\"},{\"from\":\"static/\",\"to\":\"static/\",\"filter\":\"!**/main.js\"},{\"from\":\"build/tray\",\"to\":\"static/icons\",\"filter\":\"*.png\"},{\"from\":\"extensions/\",\"to\":\"./extensions/\",\"filter\":[\"**/*.tgz\",\"**/package.json\",\"!**/node_modules\"]},{\"from\":\"templates/\",\"to\":\"./templates/\",\"filter\":\"**/*.yaml\"},\"LICENSE\"],\"linux\":{\"category\":\"Network\",\"artifactName\":\"${productName}-${version}.${arch}.${ext}\",\"target\":[\"deb\",\"rpm\",\"AppImage\"],\"extraResources\":[{\"from\":\"binaries/client/linux/${arch}/kubectl\",\"to\":\"./${arch}/kubectl\"},{\"from\":\"binaries/client/linux/${arch}/lens-k8s-proxy\",\"to\":\"./${arch}/lens-k8s-proxy\"},{\"from\":\"binaries/client/linux/${arch}/helm\",\"to\":\"./${arch}/helm\"}]},\"rpm\":{\"fpm\":[\"--rpm-rpmbuild-define=%define _build_id_links none\"]},\"mac\":{\"hardenedRuntime\":true,\"gatekeeperAssess\":false,\"entitlements\":\"build/entitlements.mac.plist\",\"entitlementsInherit\":\"build/entitlements.mac.plist\",\"extraResources\":[{\"from\":\"binaries/client/darwin/${arch}/kubectl\",\"to\":\"./${arch}/kubectl\"},{\"from\":\"binaries/client/darwin/${arch}/lens-k8s-proxy\",\"to\":\"./${arch}/lens-k8s-proxy\"},{\"from\":\"binaries/client/darwin/${arch}/helm\",\"to\":\"./${arch}/helm\"}]},\"win\":{\"target\":[\"nsis\"],\"extraResources\":[{\"from\":\"binaries/client/windows/${arch}/kubectl.exe\",\"to\":\"./${arch}/kubectl.exe\"},{\"from\":\"binaries/client/windows/${arch}/lens-k8s-proxy.exe\",\"to\":\"./${arch}/lens-k8s-proxy.exe\"},{\"from\":\"binaries/client/windows/${arch}/helm.exe\",\"to\":\"./${arch}/helm.exe\"}]},\"nsis\":{\"include\":\"build/installer.nsh\",\"oneClick\":false,\"allowElevation\":true,\"createStartMenuShortcut\":true,\"allowToChangeInstallationDirectory\":true},\"protocols\":{\"name\":\"Lens Protocol Handler\",\"schemes\":[\"lens\"],\"role\":\"Viewer\"}},\"resolutions\":{\"@astronautlabs/jsonpath/underscore\":\"^1.12.1\"},\"dependencies\":{\"@astronautlabs/jsonpath\":\"^1.1.0\",\"@hapi/call\":\"^9.0.0\",\"@hapi/subtext\":\"^7.0.4\",\"@kubernetes/client-node\":\"^0.17.1\",\"@material-ui/styles\":\"^4.11.5\",\"@ogre-tools/fp\":\"^12.0.1\",\"@ogre-tools/injectable\":\"^12.0.1\",\"@ogre-tools/injectable-extension-for-auto-registration\":\"^12.0.1\",\"@ogre-tools/injectable-extension-for-mobx\":\"^12.0.1\",\"@ogre-tools/injectable-react\":\"^12.0.1\",\"@sentry/electron\":\"^3.0.8\",\"@sentry/integrations\":\"^6.19.3\",\"@side/jest-runtime\":\"^1.0.1\",\"@types/circular-dependency-plugin\":\"5.0.5\",\"abort-controller\":\"^3.0.0\",\"auto-bind\":\"^4.0.0\",\"await-lock\":\"^2.2.2\",\"byline\":\"^5.0.0\",\"chokidar\":\"^3.5.3\",\"conf\":\"^7.1.2\",\"crypto-js\":\"^4.1.1\",\"electron-devtools-installer\":\"^3.2.0\",\"electron-updater\":\"^4.6.5\",\"electron-window-state\":\"^5.0.3\",\"filehound\":\"^1.17.6\",\"fs-extra\":\"^9.0.1\",\"glob-to-regexp\":\"^0.4.1\",\"got\":\"^11.8.5\",\"grapheme-splitter\":\"^1.0.4\",\"handlebars\":\"^4.7.7\",\"history\":\"^4.10.1\",\"http-proxy\":\"^1.18.1\",\"immer\":\"^9.0.16\",\"joi\":\"^17.7.0\",\"js-yaml\":\"^4.1.0\",\"jsdom\":\"^16.7.0\",\"lodash\":\"^4.17.15\",\"marked\":\"^4.2.3\",\"md5-file\":\"^5.0.0\",\"mobx\":\"^6.7.0\",\"mobx-observable-history\":\"^2.0.3\",\"mobx-react\":\"^7.6.0\",\"mobx-utils\":\"^6.0.4\",\"mock-fs\":\"^5.2.0\",\"moment\":\"^2.29.4\",\"moment-timezone\":\"^0.5.39\",\"monaco-editor\":\"^0.29.1\",\"monaco-editor-webpack-plugin\":\"^5.0.0\",\"node-fetch\":\"^3.3.0\",\"node-pty\":\"0.10.1\",\"npm\":\"^8.19.3\",\"p-limit\":\"^3.1.0\",\"path-to-regexp\":\"^6.2.0\",\"proper-lockfile\":\"^4.1.2\",\"react\":\"^17.0.2\",\"react-dom\":\"^17.0.2\",\"react-material-ui-carousel\":\"^2.3.11\",\"react-router\":\"^5.3.4\",\"react-virtualized-auto-sizer\":\"^1.0.7\",\"readable-stream\":\"^3.6.0\",\"request\":\"^2.88.2\",\"request-promise-native\":\"^1.0.9\",\"rfc6902\":\"^4.0.2\",\"selfsigned\":\"^2.1.1\",\"semver\":\"^7.3.8\",\"tar\":\"^6.1.12\",\"tcp-port-used\":\"^1.0.2\",\"tempy\":\"1.0.1\",\"typed-regex\":\"^0.0.8\",\"url-parse\":\"^1.5.10\",\"uuid\":\"^8.3.2\",\"win-ca\":\"^3.5.0\",\"winston\":\"^3.8.2\",\"winston-transport-browserconsole\":\"^1.0.5\",\"ws\":\"^8.11.0\",\"xterm-link-provider\":\"^1.3.1\"},\"devDependencies\":{\"@async-fn/jest\":\"1.6.4\",\"@material-ui/core\":\"^4.12.3\",\"@material-ui/icons\":\"^4.11.2\",\"@material-ui/lab\":\"^4.0.0-alpha.60\",\"@pmmmwh/react-refresh-webpack-plugin\":\"^0.5.9\",\"@sentry/types\":\"^6.19.7\",\"@swc/cli\":\"^0.1.57\",\"@swc/core\":\"^1.3.19\",\"@swc/jest\":\"^0.2.23\",\"@testing-library/dom\":\"^7.31.2\",\"@testing-library/jest-dom\":\"^5.16.5\",\"@testing-library/react\":\"^12.1.5\",\"@testing-library/user-event\":\"^13.5.0\",\"@types/byline\":\"^4.2.33\",\"@types/chart.js\":\"^2.9.36\",\"@types/circular-dependency-plugin\":\"5.0.5\",\"@types/cli-progress\":\"^3.11.0\",\"@types/color\":\"^3.0.3\",\"@types/command-line-args\":\"^5.2.0\",\"@types/crypto-js\":\"^3.1.47\",\"@types/dompurify\":\"^2.4.0\",\"@types/electron-devtools-installer\":\"^2.2.1\",\"@types/fs-extra\":\"^9.0.13\",\"@types/glob-to-regexp\":\"^0.4.1\",\"@types/gunzip-maybe\":\"^1.4.0\",\"@types/hapi__call\":\"^9.0.0\",\"@types/hapi__subtext\":\"^7.0.0\",\"@types/html-webpack-plugin\":\"^3.2.6\",\"@types/http-proxy\":\"^1.17.9\",\"@types/jest\":\"^28.1.6\",\"@types/js-yaml\":\"^4.0.5\",\"@types/jsdom\":\"^16.2.14\",\"@types/lodash\":\"^4.14.189\",\"@types/marked\":\"^4.0.7\",\"@types/md5-file\":\"^4.0.2\",\"@types/memorystream\":\"^0.3.0\",\"@types/mini-css-extract-plugin\":\"^2.4.0\",\"@types/mock-fs\":\"^4.13.1\",\"@types/node\":\"^16.18.2\",\"@types/proper-lockfile\":\"^4.1.2\",\"@types/randomcolor\":\"^0.5.6\",\"@types/react\":\"^17.0.45\",\"@types/react-beautiful-dnd\":\"^13.1.2\",\"@types/react-dom\":\"^17.0.16\",\"@types/react-router\":\"^5.1.19\",\"@types/react-router-dom\":\"^5.3.3\",\"@types/react-table\":\"^7.7.12\",\"@types/react-virtualized-auto-sizer\":\"^1.0.1\",\"@types/react-window\":\"^1.8.5\",\"@types/readable-stream\":\"^2.3.13\",\"@types/request\":\"^2.48.7\",\"@types/request-promise-native\":\"^1.0.18\",\"@types/semver\":\"^7.3.13\",\"@types/sharp\":\"^0.31.0\",\"@types/tar\":\"^6.1.3\",\"@types/tar-stream\":\"^2.2.2\",\"@types/tcp-port-used\":\"^1.0.1\",\"@types/tempy\":\"^0.3.0\",\"@types/triple-beam\":\"^1.3.2\",\"@types/url-parse\":\"^1.4.8\",\"@types/uuid\":\"^8.3.4\",\"@types/webpack\":\"^5.28.0\",\"@types/webpack-dev-server\":\"^4.7.2\",\"@types/webpack-env\":\"^1.18.0\",\"@types/webpack-node-externals\":\"^2.5.3\",\"@typescript-eslint/eslint-plugin\":\"^5.44.0\",\"@typescript-eslint/parser\":\"^5.44.0\",\"adr\":\"^1.4.3\",\"ansi_up\":\"^5.1.0\",\"chalk\":\"^4.1.2\",\"chart.js\":\"^2.9.4\",\"circular-dependency-plugin\":\"^5.2.2\",\"cli-progress\":\"^3.11.2\",\"color\":\"^3.2.1\",\"command-line-args\":\"^5.2.1\",\"concurrently\":\"^7.6.0\",\"css-loader\":\"^6.7.2\",\"deepdash\":\"^5.3.9\",\"dompurify\":\"^2.4.1\",\"electron\":\"^19.1.6\",\"electron-builder\":\"^23.6.0\",\"electron-notarize\":\"^0.3.0\",\"esbuild\":\"^0.15.15\",\"esbuild-loader\":\"^2.20.0\",\"eslint\":\"^8.28.0\",\"eslint-plugin-header\":\"^3.1.1\",\"eslint-plugin-import\":\"^2.26.0\",\"eslint-plugin-react\":\"7.31.11\",\"eslint-plugin-react-hooks\":\"^4.6.0\",\"eslint-plugin-unused-imports\":\"^2.0.0\",\"fork-ts-checker-webpack-plugin\":\"^6.5.2\",\"gunzip-maybe\":\"^1.4.2\",\"html-webpack-plugin\":\"^5.5.0\",\"identity-obj-proxy\":\"^3.0.0\",\"ignore-loader\":\"^0.1.2\",\"include-media\":\"^1.4.9\",\"jest\":\"^28.1.3\",\"jest-canvas-mock\":\"^2.3.1\",\"jest-environment-jsdom\":\"^28.1.3\",\"jest-mock-extended\":\"^2.0.9\",\"make-plural\":\"^6.2.2\",\"memorystream\":\"^0.3.1\",\"mini-css-extract-plugin\":\"^2.7.0\",\"mock-http\":\"^1.1.0\",\"node-gyp\":\"^8.3.0\",\"node-loader\":\"^2.0.0\",\"nodemon\":\"^2.0.20\",\"playwright\":\"^1.28.0\",\"postcss\":\"^8.4.19\",\"postcss-loader\":\"^6.2.1\",\"query-string\":\"^7.1.1\",\"randomcolor\":\"^0.6.2\",\"react-beautiful-dnd\":\"^13.1.1\",\"react-refresh\":\"^0.14.0\",\"react-refresh-typescript\":\"^2.0.7\",\"react-router-dom\":\"^5.3.4\",\"react-select\":\"^5.6.1\",\"react-select-event\":\"^5.5.1\",\"react-table\":\"^7.8.0\",\"react-window\":\"^1.8.8\",\"sass\":\"^1.56.1\",\"sass-loader\":\"^12.6.0\",\"sharp\":\"^0.31.2\",\"style-loader\":\"^3.3.1\",\"tailwindcss\":\"^3.2.4\",\"tar-stream\":\"^2.2.0\",\"ts-loader\":\"^9.4.1\",\"ts-node\":\"^10.9.1\",\"type-fest\":\"^2.14.0\",\"typed-emitter\":\"^1.4.0\",\"typedoc\":\"0.23.21\",\"typedoc-plugin-markdown\":\"^3.13.6\",\"typescript\":\"^4.9.3\",\"typescript-plugin-css-modules\":\"^3.4.0\",\"webpack\":\"^5.75.0\",\"webpack-cli\":\"^4.9.2\",\"webpack-dev-server\":\"^4.11.1\",\"webpack-node-externals\":\"^3.0.0\",\"xterm\":\"^4.19.0\",\"xterm-addon-fit\":\"^0.5.0\"}}');\n\n//# sourceURL=webpack://open-lens/./package.json?");
|
40827
40827
|
|
40828
40828
|
/***/ }),
|
40829
40829
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
*/
|
5
5
|
import "../../common/ipc/cluster";
|
6
6
|
import type http from "http";
|
7
|
-
import type { ObservableSet } from "mobx";
|
7
|
+
import type { IObservableValue, ObservableSet } from "mobx";
|
8
8
|
import type { Cluster } from "../../common/cluster/cluster";
|
9
9
|
import { KubernetesCluster, LensKubernetesClusterStatus } from "../../common/catalog-entities/kubernetes-cluster";
|
10
10
|
import type { ClusterStore } from "../../common/cluster-store/cluster-store";
|
@@ -14,10 +14,10 @@ interface Dependencies {
|
|
14
14
|
readonly store: ClusterStore;
|
15
15
|
readonly catalogEntityRegistry: CatalogEntityRegistry;
|
16
16
|
readonly clustersThatAreBeingDeleted: ObservableSet<ClusterId>;
|
17
|
+
readonly visibleCluster: IObservableValue<ClusterId | null>;
|
17
18
|
}
|
18
19
|
export declare class ClusterManager {
|
19
20
|
private readonly dependencies;
|
20
|
-
visibleCluster: ClusterId | undefined;
|
21
21
|
constructor(dependencies: Dependencies);
|
22
22
|
init: () => void;
|
23
23
|
protected updateCatalog(clusters: Cluster[]): void;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
declare const clusterVisibilityHandlerInjectable: import("@ogre-tools/injectable").Injectable<{
|
2
|
+
channel: import("../../common/utils/channel/message-channel-listener-injection-token").MessageChannel<string | null>;
|
3
|
+
handler: (message: string | null) => void;
|
4
|
+
}, import("../../common/utils/channel/message-channel-listener-injection-token").MessageChannelListener<import("../../common/utils/channel/message-channel-listener-injection-token").MessageChannel<unknown>>, void>;
|
5
|
+
export default clusterVisibilityHandlerInjectable;
|
package/dist/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { ClusterStore } from "../../../../common/cluster-store/cluster-store";
|
2
2
|
import type { CatalogEntityRegistry } from "../../../catalog";
|
3
|
-
import type { ClusterManager } from "../../../cluster/manager";
|
4
3
|
import type { IComputedValue } from "mobx";
|
5
4
|
import type { Theme } from "../../../theme/operating-system-theme-state.injectable";
|
6
5
|
import type { AskUserForFilePaths } from "../../../ipc/ask-user-for-file-paths.injectable";
|
@@ -11,7 +10,6 @@ import type { EmitAppEvent } from "../../../../common/app-event-bus/emit-event.i
|
|
11
10
|
import type { CreateResourceApplier } from "../../../resource-applier/create-resource-applier.injectable";
|
12
11
|
interface Dependencies {
|
13
12
|
applicationMenuItemComposite: IComputedValue<Composite<ApplicationMenuItemTypes | MenuItemRoot>>;
|
14
|
-
clusterManager: ClusterManager;
|
15
13
|
catalogEntityRegistry: CatalogEntityRegistry;
|
16
14
|
clusterStore: ClusterStore;
|
17
15
|
operatingSystemTheme: IComputedValue<Theme>;
|
@@ -19,5 +17,5 @@ interface Dependencies {
|
|
19
17
|
emitAppEvent: EmitAppEvent;
|
20
18
|
createResourceApplier: CreateResourceApplier;
|
21
19
|
}
|
22
|
-
export declare const setupIpcMainHandlers: ({ applicationMenuItemComposite,
|
20
|
+
export declare const setupIpcMainHandlers: ({ applicationMenuItemComposite, catalogEntityRegistry, clusterStore, operatingSystemTheme, askUserForFilePaths, emitAppEvent, createResourceApplier, }: Dependencies) => void;
|
23
21
|
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
declare const _default: {
|
6
|
+
injectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<Partial<Record<string, string>>>, unknown, void>;
|
7
|
+
overridingInstantiate: import("@ogre-tools/injectable").Instantiate<import("mobx").IComputedValue<Partial<Record<string, string>>>, void>;
|
8
|
+
};
|
9
|
+
export default _default;
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import type { Cluster } from "../../../common/cluster/cluster";
|
2
|
-
import type { JsonObject } from "type-fest";
|
3
2
|
export interface UpdateChartArgs {
|
4
3
|
chart: string;
|
5
|
-
values:
|
4
|
+
values: string;
|
6
5
|
version: string;
|
7
6
|
}
|
8
7
|
declare const updateHelmReleaseInjectable: import("@ogre-tools/injectable").Injectable<(cluster: Cluster, releaseName: string, namespace: string, data: UpdateChartArgs) => Promise<{
|
@@ -3,16 +3,26 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
import type { ClusterId } from "../../../common/cluster-types";
|
6
|
+
import type { Logger } from "../../../common/logger";
|
7
|
+
import type { GetClusterById } from "../../../common/cluster-store/get-by-id.injectable";
|
8
|
+
import type { EmitClusterVisibility } from "./emit-cluster-visibility.injectable";
|
6
9
|
export interface LensView {
|
7
10
|
isLoaded: boolean;
|
8
11
|
frame: HTMLIFrameElement;
|
9
12
|
}
|
13
|
+
interface Dependencies {
|
14
|
+
readonly logger: Logger;
|
15
|
+
getClusterById: GetClusterById;
|
16
|
+
emitClusterVisibility: EmitClusterVisibility;
|
17
|
+
}
|
10
18
|
export declare class ClusterFrameHandler {
|
19
|
+
protected readonly dependencies: Dependencies;
|
11
20
|
private readonly views;
|
12
|
-
constructor();
|
21
|
+
constructor(dependencies: Dependencies);
|
13
22
|
hasLoadedView(clusterId: string): boolean;
|
14
23
|
initView(clusterId: ClusterId): void;
|
15
24
|
private prevVisibleClusterChange?;
|
16
25
|
setVisibleCluster(clusterId: ClusterId | null): void;
|
17
26
|
clearVisibleCluster(): void;
|
18
27
|
}
|
28
|
+
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { MessageChannelHandler } from "../../../common/utils/channel/message-channel-listener-injection-token";
|
2
|
+
import { clusterVisibilityChannel } from "../../../common/cluster/visibility-channel";
|
3
|
+
export type EmitClusterVisibility = MessageChannelHandler<typeof clusterVisibilityChannel>;
|
4
|
+
declare const emitClusterVisibilityInjectable: import("@ogre-tools/injectable").Injectable<(message: string | null) => void, unknown, void>;
|
5
|
+
export default emitClusterVisibilityInjectable;
|
@@ -2,6 +2,7 @@ import type { IComputedValue } from "mobx";
|
|
2
2
|
import type { SingleValue } from "react-select";
|
3
3
|
import type { HelmChartVersion } from "../../+helm-charts/helm-charts/versions";
|
4
4
|
import type { HelmRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
5
|
+
import type { AsyncResult } from "../../../../common/utils/async-result";
|
5
6
|
import type { SelectOption } from "../../select";
|
6
7
|
export interface UpgradeChartModel {
|
7
8
|
readonly release: HelmRelease;
|
@@ -16,10 +17,7 @@ export interface UpgradeChartModel {
|
|
16
17
|
readonly value: IComputedValue<HelmChartVersion | undefined>;
|
17
18
|
set: (value: SingleValue<SelectOption<HelmChartVersion>>) => void;
|
18
19
|
};
|
19
|
-
submit: () => Promise<
|
20
|
-
}
|
21
|
-
export interface UpgradeChartSubmitResult {
|
22
|
-
completedSuccessfully: boolean;
|
20
|
+
submit: () => Promise<AsyncResult<void, string>>;
|
23
21
|
}
|
24
22
|
declare const upgradeChartModelInjectable: import("@ogre-tools/injectable").Injectable<Promise<UpgradeChartModel>, unknown, Required<import("../dock/store").DockTabCreate>>;
|
25
23
|
export default upgradeChartModelInjectable;
|
@@ -14,7 +14,7 @@ interface Dependencies {
|
|
14
14
|
model: UpgradeChartModel;
|
15
15
|
}
|
16
16
|
export declare class NonInjectedUpgradeChart extends React.Component<UpgradeChartProps & Dependencies> {
|
17
|
-
upgrade: () => Promise<JSX.Element
|
17
|
+
upgrade: () => Promise<JSX.Element>;
|
18
18
|
render(): JSX.Element;
|
19
19
|
}
|
20
20
|
export declare const UpgradeChart: React.FunctionComponent<UpgradeChartProps>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
/// <reference types="jest" />
|
6
|
+
/**
|
7
|
+
* Conditionally run a test
|
8
|
+
*/
|
9
|
+
export declare function itIf(condition: boolean): jest.It;
|
10
|
+
/**
|
11
|
+
* Conditionally run a block of tests
|
12
|
+
*/
|
13
|
+
export declare function describeIf(condition: boolean): jest.Describe;
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@k8slens/extensions",
|
3
3
|
"productName": "OpenLens extensions",
|
4
4
|
"description": "OpenLens - Open Source Kubernetes IDE: extensions",
|
5
|
-
"version": "6.3.0-git.
|
5
|
+
"version": "6.3.0-git.95cee3bcc8.0",
|
6
6
|
"copyright": "© 2022 OpenLens Authors",
|
7
7
|
"license": "MIT",
|
8
8
|
"main": "dist/src/extensions/extension-api.js",
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
-
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
-
*/
|
5
|
-
export declare const DSTRootCAX3 = "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\nMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\nDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\nPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\nEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\nrz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\nOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\nxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\naeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\nSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\nikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\nAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\nR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\nJDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\nOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n-----END CERTIFICATE-----\n";
|
6
|
-
export declare function isCertActive(cert: string): boolean;
|
7
|
-
/**
|
8
|
-
* Get root CA certificate from MacOSX system keychain
|
9
|
-
* Only return non-expred certificates.
|
10
|
-
*/
|
11
|
-
export declare function getMacRootCA(): Promise<string[]>;
|
12
|
-
/**
|
13
|
-
* Get root CA certificate from Windows system certificate store.
|
14
|
-
* Only return non-expred certificates.
|
15
|
-
*/
|
16
|
-
export declare function getWinRootCA(): Promise<string[]>;
|
17
|
-
/**
|
18
|
-
* Add (or merge) CAs to https.globalAgent.options.ca
|
19
|
-
*/
|
20
|
-
export declare function injectCAs(CAs: string[]): void;
|
21
|
-
/**
|
22
|
-
* Inject CAs found in OS's (Windoes/MacOSX only) root certificate store to https.globalAgent.options.ca
|
23
|
-
*/
|
24
|
-
export declare function injectSystemCAs(): Promise<void>;
|