@k8slens/extensions 5.4.0-git.b65f6e00ec.0 → 5.4.0-git.c04a3b8d33.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/app-paths/directory-for-bundled-binaries/directory-for-bundled-binaries.injectable.d.ts +3 -0
- package/dist/src/common/vars/context-dir.injectable.d.ts +3 -0
- package/dist/src/common/vars/is-development.injectable.d.ts +3 -0
- package/dist/src/extensions/extension-api.js +2 -2
- package/dist/src/main/kube-auth-proxy/kube-auth-proxy.d.ts +1 -2
- package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
- package/package.json +1 -1
|
@@ -32370,7 +32370,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
32370
32370
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
32371
32371
|
|
|
32372
32372
|
"use strict";
|
|
32373
|
-
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 electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _kube_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-helpers */ \"./src/common/kube-helpers.ts\");\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _main_cluster_detectors_version_detector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../main/cluster-detectors/version-detector */ \"./src/main/cluster-detectors/version-detector.ts\");\n/* harmony import */ var _main_cluster_detectors_detector_registry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../main/cluster-detectors/detector-registry */ \"./src/main/cluster-detectors/detector-registry.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\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\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n constructor(dependencies, model) {\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_10__.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_12__.makeObservable)(this);\n this.id = model.id;\n this.updateModel(model);\n const { config } = (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.loadConfigFromFileSync)(this.kubeConfigPath);\n const validationError = (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.validateKubeConfig)(config, this.contextName);\n if (validationError) {\n throw validationError;\n }\n this.apiUrl = config.getCluster(config.getContextObject(this.contextName).cluster).server;\n if (electron__WEBPACK_IMPORTED_MODULE_0__.ipcMain) {\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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_12__.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_9__.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_9__.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_10__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\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 this.kubeConfigPath = model.kubeConfigPath;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.contextName) {\n this.contextName = model.contextName;\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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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_12__.reaction)(() => this.getState(), state => this.pushState(state)), (0,mobx__WEBPACK_IMPORTED_MODULE_12__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_12__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_12__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n await this.reconnect();\n }\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n if (this.accessible) {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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, _b;\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: reconnect`, this.getMeta());\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n await ((_b = this.contextHandler) === null || _b === void 0 ? void 0 : _b.ensureServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n * @param opts refresh options\n */\n async refresh(opts = {}) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const metadata = await _main_cluster_detectors_detector_registry__WEBPACK_IMPORTED_MODULE_7__.DetectorRegistry.getInstance().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_9__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.loadConfigFromFile)(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.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 = new _main_cluster_detectors_version_detector__WEBPACK_IMPORTED_MODULE_6__.VersionDetector(this);\n const versionData = await versionDetector.detect();\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${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_9__.ClusterStatus.AccessDenied;\n }\n this.broadcastConnectUpdate(error.error || error.message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.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_9__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessDenied;\n }\n this.broadcastConnectUpdate(error.message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_10__.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_10__.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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].silly(`[CLUSTER]: push-state`, state);\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.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.namespace].filter(Boolean);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__.HttpError && error.statusCode === 403) {\n const { response } = error;\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.broadcastMessage)(_ipc_cluster__WEBPACK_IMPORTED_MODULE_11__.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_4__.apiResources.filter((resource) => this.resourceAccessStatuses.get(resource) === undefined);\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_8___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_4__.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_4__.apiResourceRecord) {\n return this.allowedResources.includes(kind);\n }\n const apiResource = _rbac__WEBPACK_IMPORTED_MODULE_4__.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_9__.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_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedResources\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"accessibleNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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?");
|
|
32373
|
+
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 electron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! electron */ \"electron\");\n/* harmony import */ var electron__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(electron__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _ipc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ipc */ \"./src/common/ipc/index.ts\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _kube_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-helpers */ \"./src/common/kube-helpers.ts\");\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var _main_logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../main/logger */ \"./src/main/logger.ts\");\n/* harmony import */ var _main_cluster_detectors_version_detector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../main/cluster-detectors/version-detector */ \"./src/main/cluster-detectors/version-detector.ts\");\n/* harmony import */ var _main_cluster_detectors_detector_registry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../main/cluster-detectors/detector-registry */ \"./src/main/cluster-detectors/detector-registry.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\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\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n constructor(dependencies, model) {\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_10__.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_12__.makeObservable)(this);\n this.id = model.id;\n this.updateModel(model);\n const { config } = (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.loadConfigFromFileSync)(this.kubeConfigPath);\n const validationError = (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.validateKubeConfig)(config, this.contextName);\n if (validationError) {\n throw validationError;\n }\n this.apiUrl = config.getCluster(config.getContextObject(this.contextName).cluster).server;\n if (electron__WEBPACK_IMPORTED_MODULE_0__.ipcMain) {\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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_12__.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_9__.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_9__.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_10__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\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 this.kubeConfigPath = model.kubeConfigPath;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.contextName) {\n this.contextName = model.contextName;\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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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_12__.reaction)(() => this.getState(), state => this.pushState(state)), (0,mobx__WEBPACK_IMPORTED_MODULE_12__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_12__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_12__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n await this.reconnect();\n }\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n if (this.accessible) {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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, _b;\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: reconnect`, this.getMeta());\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n await ((_b = this.contextHandler) === null || _b === void 0 ? void 0 : _b.ensureServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n if (this.disconnected) {\n return void _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(\"[CLUSTER]: already disconnected\", { id: this.id });\n }\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n * @param opts refresh options\n */\n async refresh(opts = {}) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const metadata = await _main_cluster_detectors_detector_registry__WEBPACK_IMPORTED_MODULE_7__.DetectorRegistry.getInstance().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_9__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.loadConfigFromFile)(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await (0,_kube_helpers__WEBPACK_IMPORTED_MODULE_3__.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 = new _main_cluster_detectors_version_detector__WEBPACK_IMPORTED_MODULE_6__.VersionDetector(this);\n const versionData = await versionDetector.detect();\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${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_9__.ClusterStatus.AccessDenied;\n }\n this.broadcastConnectUpdate(error.error || error.message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.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_9__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.AccessDenied;\n }\n this.broadcastConnectUpdate(error.message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_9__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_10__.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_10__.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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].silly(`[CLUSTER]: push-state`, state);\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.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 _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.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.namespace].filter(Boolean);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_2__.HttpError && error.statusCode === 403) {\n const { response } = error;\n _main_logger__WEBPACK_IMPORTED_MODULE_5__[\"default\"].info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n (0,_ipc__WEBPACK_IMPORTED_MODULE_1__.broadcastMessage)(_ipc_cluster__WEBPACK_IMPORTED_MODULE_11__.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_4__.apiResources.filter((resource) => this.resourceAccessStatuses.get(resource) === undefined);\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_8___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_4__.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_4__.apiResourceRecord) {\n return this.allowedResources.includes(kind);\n }\n const apiResource = _rbac__WEBPACK_IMPORTED_MODULE_4__.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_9__.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_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"allowedResources\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"accessibleNamespaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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_12__.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?");
|
|
32374
32374
|
|
|
32375
32375
|
/***/ }),
|
|
32376
32376
|
|
|
@@ -40933,7 +40933,7 @@ eval("module.exports = JSON.parse('{\"name\":\"winston\",\"description\":\"A log
|
|
|
40933
40933
|
/***/ ((module) => {
|
|
40934
40934
|
|
|
40935
40935
|
"use strict";
|
|
40936
|
-
eval("module.exports = JSON.parse('{\"name\":\"open-lens\",\"productName\":\"OpenLens\",\"description\":\"OpenLens - Open Source IDE for Kubernetes\",\"homepage\":\"https://github.com/lensapp/lens\",\"version\":\"5.4.0-beta.5\",\"main\":\"static/build/main.js\",\"copyright\":\"© 2021 OpenLens Authors\",\"license\":\"MIT\",\"author\":{\"name\":\"OpenLens Authors\",\"email\":\"info@k8slens.dev\"},\"scripts\":{\"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 compile:renderer --watch --progress\",\"dev:extension-types\":\"yarn run compile:extension-types --watch --progress\",\"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\",\"npm:fix-build-version\":\"yarn run ts-node build/set_build_version.ts\",\"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\",\"dist\":\"yarn run compile && electron-builder --publish onTag\",\"dist:dir\":\"yarn run dist --dir -c.compression=store -c.mac.identity=null\",\"download-bins\":\"concurrently yarn:download:*\",\"download:kubectl\":\"yarn run ts-node build/download_kubectl.ts\",\"download:helm\":\"yarn run ts-node build/download_helm.ts\",\"build:tray-icons\":\"yarn run ts-node build/build_tray_icon.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\"},\"config\":{\"bundledKubectlVersion\":\"1.23.3\",\"bundledHelmVersion\":\"3.7.2\",\"sentryDsn\":\"\"},\"engines\":{\"node\":\">=14 <15\"},\"jest\":{\"collectCoverage\":false,\"verbose\":true,\"transform\":{\"^.+\\\\\\\\.tsx?$\":\"ts-jest\"},\"moduleNameMapper\":{\"\\\\\\\\.(css|scss)$\":\"<rootDir>/__mocks__/styleMock.ts\",\"\\\\\\\\.(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\"],\"globals\":{\"ts-jest\":{\"isolatedModules\":true}}},\"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/${arch}/helm3/helm3\",\"to\":\"./helm3/helm3\"}]},\"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/${arch}/helm3/helm3\",\"to\":\"./helm3/helm3\"}]},\"win\":{\"target\":[\"nsis\"],\"extraResources\":[{\"from\":\"binaries/client/windows/x64/kubectl.exe\",\"to\":\"./x64/kubectl.exe\"},{\"from\":\"binaries/client/windows/ia32/kubectl.exe\",\"to\":\"./ia32/kubectl.exe\"},{\"from\":\"binaries/client/x64/helm3/helm3.exe\",\"to\":\"./helm3/helm3.exe\"}]},\"nsis\":{\"include\":\"build/installer.nsh\",\"oneClick\":false,\"allowElevation\":true,\"createStartMenuShortcut\":true,\"allowToChangeInstallationDirectory\":true},\"protocols\":{\"name\":\"Lens Protocol Handler\",\"schemes\":[\"lens\"],\"role\":\"Viewer\"}},\"dependencies\":{\"@hapi/call\":\"^8.0.1\",\"@hapi/subtext\":\"^7.0.3\",\"@kubernetes/client-node\":\"^0.16.1\",\"@ogre-tools/injectable\":\"5.0.1\",\"@ogre-tools/injectable-react\":\"5.0.1\",\"@sentry/electron\":\"^2.5.4\",\"@sentry/integrations\":\"^6.15.0\",\"@types/circular-dependency-plugin\":\"5.0.4\",\"abort-controller\":\"^3.0.0\",\"auto-bind\":\"^4.0.0\",\"autobind-decorator\":\"^2.4.0\",\"await-lock\":\"^2.1.0\",\"byline\":\"^5.0.0\",\"chokidar\":\"^3.4.3\",\"conf\":\"^7.1.2\",\"crypto-js\":\"^4.1.1\",\"electron-devtools-installer\":\"^3.2.0\",\"electron-updater\":\"^4.6.1\",\"electron-window-state\":\"^5.0.3\",\"filehound\":\"^1.17.5\",\"fs-extra\":\"^9.0.1\",\"glob-to-regexp\":\"^0.4.1\",\"got\":\"^11.8.3\",\"grapheme-splitter\":\"^1.0.4\",\"handlebars\":\"^4.7.7\",\"http-proxy\":\"^1.18.1\",\"immer\":\"^9.0.6\",\"joi\":\"^17.5.0\",\"js-yaml\":\"^4.1.0\",\"jsdom\":\"^16.7.0\",\"jsonpath\":\"^1.1.1\",\"lodash\":\"^4.17.15\",\"mac-ca\":\"^1.0.6\",\"marked\":\"^4.0.10\",\"md5-file\":\"^5.0.0\",\"mobx\":\"^6.3.7\",\"mobx-observable-history\":\"^2.0.3\",\"mobx-react\":\"^7.2.1\",\"mock-fs\":\"^5.1.2\",\"moment\":\"^2.29.1\",\"moment-timezone\":\"^0.5.34\",\"monaco-editor\":\"^0.29.1\",\"monaco-editor-webpack-plugin\":\"^5.0.0\",\"node-fetch\":\"lensapp/node-fetch#2.x\",\"node-pty\":\"^0.10.1\",\"npm\":\"^6.14.15\",\"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.8\",\"react-router\":\"^5.2.0\",\"react-virtualized-auto-sizer\":\"^1.0.6\",\"readable-stream\":\"^3.6.0\",\"request\":\"^2.88.2\",\"request-promise-native\":\"^1.0.9\",\"rfc6902\":\"^4.0.2\",\"semver\":\"^7.3.2\",\"shell-env\":\"^3.0.1\",\"spdy\":\"^4.0.2\",\"tar\":\"^6.1.11\",\"tcp-port-used\":\"^1.0.2\",\"tempy\":\"1.0.1\",\"url-parse\":\"^1.5.3\",\"uuid\":\"^8.3.2\",\"win-ca\":\"^3.4.5\",\"winston\":\"^3.3.3\",\"winston-console-format\":\"^1.0.8\",\"winston-transport-browserconsole\":\"^1.0.5\",\"ws\":\"^7.5.5\"},\"devDependencies\":{\"@async-fn/jest\":\"1.5.3\",\"@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.4\",\"@sentry/types\":\"^6.14.1\",\"@testing-library/jest-dom\":\"^5.16.1\",\"@testing-library/react\":\"^11.2.7\",\"@testing-library/user-event\":\"^13.5.0\",\"@types/byline\":\"^4.2.33\",\"@types/chart.js\":\"^2.9.34\",\"@types/color\":\"^3.0.2\",\"@types/crypto-js\":\"^3.1.47\",\"@types/dompurify\":\"^2.3.1\",\"@types/electron-devtools-installer\":\"^2.2.0\",\"@types/fs-extra\":\"^9.0.13\",\"@types/glob-to-regexp\":\"^0.4.1\",\"@types/hoist-non-react-statics\":\"^3.3.1\",\"@types/html-webpack-plugin\":\"^3.2.6\",\"@types/http-proxy\":\"^1.17.7\",\"@types/jest\":\"^26.0.24\",\"@types/js-yaml\":\"^4.0.5\",\"@types/jsdom\":\"^16.2.13\",\"@types/jsonpath\":\"^0.2.0\",\"@types/lodash\":\"^4.14.177\",\"@types/marked\":\"^4.0.1\",\"@types/md5-file\":\"^4.0.2\",\"@types/mini-css-extract-plugin\":\"^2.4.0\",\"@types/mock-fs\":\"^4.13.1\",\"@types/node\":\"14.17.33\",\"@types/node-fetch\":\"^2.5.12\",\"@types/npm\":\"^2.0.32\",\"@types/proper-lockfile\":\"^4.1.2\",\"@types/randomcolor\":\"^0.5.6\",\"@types/react\":\"^17.0.34\",\"@types/react-beautiful-dnd\":\"^13.1.2\",\"@types/react-dom\":\"^17.0.11\",\"@types/react-router-dom\":\"^5.3.2\",\"@types/react-select\":\"3.1.2\",\"@types/react-table\":\"^7.7.9\",\"@types/react-virtualized-auto-sizer\":\"^1.0.1\",\"@types/react-window\":\"^1.8.5\",\"@types/readable-stream\":\"^2.3.12\",\"@types/request\":\"^2.48.7\",\"@types/request-promise-native\":\"^1.0.18\",\"@types/semver\":\"^7.3.9\",\"@types/sharp\":\"^0.29.4\",\"@types/spdy\":\"^3.4.5\",\"@types/tar\":\"^4.0.5\",\"@types/tcp-port-used\":\"^1.0.0\",\"@types/tempy\":\"^0.3.0\",\"@types/triple-beam\":\"^1.3.2\",\"@types/url-parse\":\"^1.4.5\",\"@types/uuid\":\"^8.3.3\",\"@types/webpack\":\"^5.28.0\",\"@types/webpack-dev-server\":\"^4.7.2\",\"@types/webpack-env\":\"^1.16.3\",\"@types/webpack-node-externals\":\"^2.5.3\",\"@typescript-eslint/eslint-plugin\":\"^5.10.1\",\"@typescript-eslint/parser\":\"^5.10.1\",\"ansi_up\":\"^5.1.0\",\"chart.js\":\"^2.9.4\",\"circular-dependency-plugin\":\"^5.2.2\",\"color\":\"^3.2.1\",\"concurrently\":\"^7.0.0\",\"css-loader\":\"^6.5.1\",\"deepdash\":\"^5.3.9\",\"dompurify\":\"^2.3.4\",\"electron\":\"^14.2.4\",\"electron-builder\":\"^22.14.5\",\"electron-notarize\":\"^0.3.0\",\"esbuild\":\"^0.13.15\",\"esbuild-loader\":\"^2.18.0\",\"eslint\":\"^8.7.0\",\"eslint-plugin-header\":\"^3.1.1\",\"eslint-plugin-import\":\"^2.25.4\",\"eslint-plugin-react\":\"^7.28.0\",\"eslint-plugin-react-hooks\":\"^4.3.0\",\"eslint-plugin-unused-imports\":\"^2.0.0\",\"flex.box\":\"^3.4.4\",\"fork-ts-checker-webpack-plugin\":\"^6.5.0\",\"hoist-non-react-statics\":\"^3.3.2\",\"html-webpack-plugin\":\"^5.5.0\",\"ignore-loader\":\"^0.1.2\",\"include-media\":\"^1.4.9\",\"jest\":\"26.6.3\",\"jest-canvas-mock\":\"^2.3.1\",\"jest-fetch-mock\":\"^3.0.3\",\"jest-mock-extended\":\"^1.0.18\",\"make-plural\":\"^6.2.2\",\"mini-css-extract-plugin\":\"^2.5.2\",\"node-gyp\":\"7.1.2\",\"node-loader\":\"^2.0.0\",\"nodemon\":\"^2.0.15\",\"playwright\":\"^1.17.1\",\"postcss\":\"^8.4.5\",\"postcss-loader\":\"^6.2.1\",\"randomcolor\":\"^0.6.2\",\"react-beautiful-dnd\":\"^13.1.0\",\"react-refresh\":\"^0.11.0\",\"react-refresh-typescript\":\"^2.0.3\",\"react-router-dom\":\"^5.3.0\",\"react-select\":\"3.2.0\",\"react-select-event\":\"^5.1.0\",\"react-table\":\"^7.7.0\",\"react-window\":\"^1.8.6\",\"sass\":\"^1.45.1\",\"sass-loader\":\"^12.4.0\",\"sharp\":\"^0.29.3\",\"style-loader\":\"^3.3.1\",\"tailwindcss\":\"^3.0.7\",\"ts-jest\":\"26.5.6\",\"ts-loader\":\"^9.2.6\",\"ts-node\":\"^10.4.0\",\"type-fest\":\"^1.0.2\",\"typed-emitter\":\"^1.4.0\",\"typedoc\":\"0.22.10\",\"typedoc-plugin-markdown\":\"^3.11.12\",\"typeface-roboto\":\"^1.1.13\",\"typescript\":\"^4.5.2\",\"typescript-plugin-css-modules\":\"^3.4.0\",\"webpack\":\"^5.69.0\",\"webpack-cli\":\"^4.9.2\",\"webpack-dev-server\":\"^4.7.4\",\"webpack-node-externals\":\"^3.0.0\",\"xterm\":\"^4.15.0\",\"xterm-addon-fit\":\"^0.5.0\"}}');\n\n//# sourceURL=webpack://open-lens/./package.json?");
|
|
40936
|
+
eval("module.exports = JSON.parse('{\"name\":\"open-lens\",\"productName\":\"OpenLens\",\"description\":\"OpenLens - Open Source IDE for Kubernetes\",\"homepage\":\"https://github.com/lensapp/lens\",\"version\":\"5.4.0-beta.5\",\"main\":\"static/build/main.js\",\"copyright\":\"© 2021 OpenLens Authors\",\"license\":\"MIT\",\"author\":{\"name\":\"OpenLens Authors\",\"email\":\"info@k8slens.dev\"},\"scripts\":{\"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 compile:renderer --watch --progress\",\"dev:extension-types\":\"yarn run compile:extension-types --watch --progress\",\"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\",\"npm:fix-build-version\":\"yarn run ts-node build/set_build_version.ts\",\"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\",\"dist\":\"yarn run compile && electron-builder --publish onTag\",\"dist:dir\":\"yarn run dist --dir -c.compression=store -c.mac.identity=null\",\"download-bins\":\"concurrently yarn:download:*\",\"download:kubectl\":\"yarn run ts-node build/download_kubectl.ts\",\"download:helm\":\"yarn run ts-node build/download_helm.ts\",\"download:k8s-proxy\":\"yarn run ts-node build/download_k8s_proxy.ts\",\"build:tray-icons\":\"yarn run ts-node build/build_tray_icon.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\"},\"config\":{\"k8sProxyVersion\":\"0.1.2\",\"bundledKubectlVersion\":\"1.23.3\",\"bundledHelmVersion\":\"3.7.2\",\"sentryDsn\":\"\"},\"engines\":{\"node\":\">=14 <15\"},\"jest\":{\"collectCoverage\":false,\"verbose\":true,\"transform\":{\"^.+\\\\\\\\.tsx?$\":\"ts-jest\"},\"moduleNameMapper\":{\"\\\\\\\\.(css|scss)$\":\"<rootDir>/__mocks__/styleMock.ts\",\"\\\\\\\\.(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\"],\"globals\":{\"ts-jest\":{\"isolatedModules\":true}}},\"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/${arch}/helm3/helm3\",\"to\":\"./helm3/helm3\"}]},\"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/${arch}/helm3/helm3\",\"to\":\"./helm3/helm3\"}]},\"win\":{\"target\":[\"nsis\"],\"extraResources\":[{\"from\":\"binaries/client/windows/x64/kubectl.exe\",\"to\":\"./x64/kubectl.exe\"},{\"from\":\"binaries/client/windows/ia32/kubectl.exe\",\"to\":\"./ia32/kubectl.exe\"},{\"from\":\"binaries/client/windows/x64/lens-k8s-proxy\",\"to\":\"./x64/lens-k8s-proxy.exe\"},{\"from\":\"binaries/client/windows/ia32/lens-k8s-proxy\",\"to\":\"./ia32/lens-k8s-proxy.exe\"},{\"from\":\"binaries/client/x64/helm3/helm3.exe\",\"to\":\"./helm3/helm3.exe\"}]},\"nsis\":{\"include\":\"build/installer.nsh\",\"oneClick\":false,\"allowElevation\":true,\"createStartMenuShortcut\":true,\"allowToChangeInstallationDirectory\":true},\"protocols\":{\"name\":\"Lens Protocol Handler\",\"schemes\":[\"lens\"],\"role\":\"Viewer\"}},\"dependencies\":{\"@hapi/call\":\"^8.0.1\",\"@hapi/subtext\":\"^7.0.3\",\"@kubernetes/client-node\":\"^0.16.1\",\"@ogre-tools/injectable\":\"5.0.1\",\"@ogre-tools/injectable-react\":\"5.0.1\",\"@sentry/electron\":\"^2.5.4\",\"@sentry/integrations\":\"^6.15.0\",\"@types/circular-dependency-plugin\":\"5.0.4\",\"abort-controller\":\"^3.0.0\",\"auto-bind\":\"^4.0.0\",\"autobind-decorator\":\"^2.4.0\",\"await-lock\":\"^2.1.0\",\"byline\":\"^5.0.0\",\"chokidar\":\"^3.4.3\",\"conf\":\"^7.1.2\",\"crypto-js\":\"^4.1.1\",\"electron-devtools-installer\":\"^3.2.0\",\"electron-updater\":\"^4.6.1\",\"electron-window-state\":\"^5.0.3\",\"filehound\":\"^1.17.5\",\"fs-extra\":\"^9.0.1\",\"glob-to-regexp\":\"^0.4.1\",\"got\":\"^11.8.3\",\"grapheme-splitter\":\"^1.0.4\",\"handlebars\":\"^4.7.7\",\"http-proxy\":\"^1.18.1\",\"immer\":\"^9.0.6\",\"joi\":\"^17.5.0\",\"js-yaml\":\"^4.1.0\",\"jsdom\":\"^16.7.0\",\"jsonpath\":\"^1.1.1\",\"lodash\":\"^4.17.15\",\"mac-ca\":\"^1.0.6\",\"marked\":\"^4.0.10\",\"md5-file\":\"^5.0.0\",\"mobx\":\"^6.3.7\",\"mobx-observable-history\":\"^2.0.3\",\"mobx-react\":\"^7.2.1\",\"mock-fs\":\"^5.1.2\",\"moment\":\"^2.29.1\",\"moment-timezone\":\"^0.5.34\",\"monaco-editor\":\"^0.29.1\",\"monaco-editor-webpack-plugin\":\"^5.0.0\",\"node-fetch\":\"lensapp/node-fetch#2.x\",\"node-pty\":\"^0.10.1\",\"npm\":\"^6.14.15\",\"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.8\",\"react-router\":\"^5.2.0\",\"react-virtualized-auto-sizer\":\"^1.0.6\",\"readable-stream\":\"^3.6.0\",\"request\":\"^2.88.2\",\"request-promise-native\":\"^1.0.9\",\"rfc6902\":\"^4.0.2\",\"semver\":\"^7.3.2\",\"shell-env\":\"^3.0.1\",\"spdy\":\"^4.0.2\",\"tar\":\"^6.1.11\",\"tcp-port-used\":\"^1.0.2\",\"tempy\":\"1.0.1\",\"url-parse\":\"^1.5.3\",\"uuid\":\"^8.3.2\",\"win-ca\":\"^3.4.5\",\"winston\":\"^3.3.3\",\"winston-console-format\":\"^1.0.8\",\"winston-transport-browserconsole\":\"^1.0.5\",\"ws\":\"^7.5.5\"},\"devDependencies\":{\"@async-fn/jest\":\"1.5.3\",\"@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.4\",\"@sentry/types\":\"^6.14.1\",\"@testing-library/jest-dom\":\"^5.16.1\",\"@testing-library/react\":\"^11.2.7\",\"@testing-library/user-event\":\"^13.5.0\",\"@types/byline\":\"^4.2.33\",\"@types/chart.js\":\"^2.9.34\",\"@types/color\":\"^3.0.2\",\"@types/crypto-js\":\"^3.1.47\",\"@types/dompurify\":\"^2.3.1\",\"@types/electron-devtools-installer\":\"^2.2.0\",\"@types/fs-extra\":\"^9.0.13\",\"@types/glob-to-regexp\":\"^0.4.1\",\"@types/hoist-non-react-statics\":\"^3.3.1\",\"@types/html-webpack-plugin\":\"^3.2.6\",\"@types/http-proxy\":\"^1.17.7\",\"@types/jest\":\"^26.0.24\",\"@types/js-yaml\":\"^4.0.5\",\"@types/jsdom\":\"^16.2.13\",\"@types/jsonpath\":\"^0.2.0\",\"@types/lodash\":\"^4.14.177\",\"@types/marked\":\"^4.0.1\",\"@types/md5-file\":\"^4.0.2\",\"@types/mini-css-extract-plugin\":\"^2.4.0\",\"@types/mock-fs\":\"^4.13.1\",\"@types/node\":\"14.17.33\",\"@types/node-fetch\":\"^2.5.12\",\"@types/npm\":\"^2.0.32\",\"@types/proper-lockfile\":\"^4.1.2\",\"@types/randomcolor\":\"^0.5.6\",\"@types/react\":\"^17.0.34\",\"@types/react-beautiful-dnd\":\"^13.1.2\",\"@types/react-dom\":\"^17.0.11\",\"@types/react-router-dom\":\"^5.3.2\",\"@types/react-select\":\"3.1.2\",\"@types/react-table\":\"^7.7.9\",\"@types/react-virtualized-auto-sizer\":\"^1.0.1\",\"@types/react-window\":\"^1.8.5\",\"@types/readable-stream\":\"^2.3.12\",\"@types/request\":\"^2.48.7\",\"@types/request-promise-native\":\"^1.0.18\",\"@types/semver\":\"^7.3.9\",\"@types/sharp\":\"^0.29.4\",\"@types/spdy\":\"^3.4.5\",\"@types/tar\":\"^4.0.5\",\"@types/tcp-port-used\":\"^1.0.0\",\"@types/tempy\":\"^0.3.0\",\"@types/triple-beam\":\"^1.3.2\",\"@types/url-parse\":\"^1.4.5\",\"@types/uuid\":\"^8.3.3\",\"@types/webpack\":\"^5.28.0\",\"@types/webpack-dev-server\":\"^4.7.2\",\"@types/webpack-env\":\"^1.16.3\",\"@types/webpack-node-externals\":\"^2.5.3\",\"@typescript-eslint/eslint-plugin\":\"^5.10.1\",\"@typescript-eslint/parser\":\"^5.10.1\",\"ansi_up\":\"^5.1.0\",\"chart.js\":\"^2.9.4\",\"circular-dependency-plugin\":\"^5.2.2\",\"color\":\"^3.2.1\",\"concurrently\":\"^7.0.0\",\"css-loader\":\"^6.5.1\",\"deepdash\":\"^5.3.9\",\"dompurify\":\"^2.3.4\",\"electron\":\"^14.2.4\",\"electron-builder\":\"^22.14.5\",\"electron-notarize\":\"^0.3.0\",\"esbuild\":\"^0.13.15\",\"esbuild-loader\":\"^2.18.0\",\"eslint\":\"^8.7.0\",\"eslint-plugin-header\":\"^3.1.1\",\"eslint-plugin-import\":\"^2.25.4\",\"eslint-plugin-react\":\"^7.28.0\",\"eslint-plugin-react-hooks\":\"^4.3.0\",\"eslint-plugin-unused-imports\":\"^2.0.0\",\"flex.box\":\"^3.4.4\",\"fork-ts-checker-webpack-plugin\":\"^6.5.0\",\"hoist-non-react-statics\":\"^3.3.2\",\"html-webpack-plugin\":\"^5.5.0\",\"ignore-loader\":\"^0.1.2\",\"include-media\":\"^1.4.9\",\"jest\":\"26.6.3\",\"jest-canvas-mock\":\"^2.3.1\",\"jest-fetch-mock\":\"^3.0.3\",\"jest-mock-extended\":\"^1.0.18\",\"make-plural\":\"^6.2.2\",\"mini-css-extract-plugin\":\"^2.5.2\",\"node-gyp\":\"7.1.2\",\"node-loader\":\"^2.0.0\",\"nodemon\":\"^2.0.15\",\"playwright\":\"^1.17.1\",\"postcss\":\"^8.4.5\",\"postcss-loader\":\"^6.2.1\",\"randomcolor\":\"^0.6.2\",\"react-beautiful-dnd\":\"^13.1.0\",\"react-refresh\":\"^0.11.0\",\"react-refresh-typescript\":\"^2.0.3\",\"react-router-dom\":\"^5.3.0\",\"react-select\":\"3.2.0\",\"react-select-event\":\"^5.1.0\",\"react-table\":\"^7.7.0\",\"react-window\":\"^1.8.6\",\"sass\":\"^1.45.1\",\"sass-loader\":\"^12.4.0\",\"sharp\":\"^0.29.3\",\"style-loader\":\"^3.3.1\",\"tailwindcss\":\"^3.0.7\",\"ts-jest\":\"26.5.6\",\"ts-loader\":\"^9.2.6\",\"ts-node\":\"^10.4.0\",\"type-fest\":\"^1.0.2\",\"typed-emitter\":\"^1.4.0\",\"typedoc\":\"0.22.10\",\"typedoc-plugin-markdown\":\"^3.11.12\",\"typeface-roboto\":\"^1.1.13\",\"typescript\":\"^4.5.2\",\"typescript-plugin-css-modules\":\"^3.4.0\",\"webpack\":\"^5.69.0\",\"webpack-cli\":\"^4.9.2\",\"webpack-dev-server\":\"^4.7.4\",\"webpack-node-externals\":\"^3.0.0\",\"xterm\":\"^4.15.0\",\"xterm-addon-fit\":\"^0.5.0\"}}');\n\n//# sourceURL=webpack://open-lens/./package.json?");
|
|
40937
40937
|
|
|
40938
40938
|
/***/ }),
|
|
40939
40939
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ChildProcess } from "child_process";
|
|
7
7
|
import type { Cluster } from "../../common/cluster/cluster";
|
|
8
8
|
interface Dependencies {
|
|
9
|
-
|
|
9
|
+
proxyBinPath: string;
|
|
10
10
|
}
|
|
11
11
|
export declare class KubeAuthProxy {
|
|
12
12
|
private dependencies;
|
|
@@ -16,7 +16,6 @@ export declare class KubeAuthProxy {
|
|
|
16
16
|
get port(): number;
|
|
17
17
|
protected _port: number;
|
|
18
18
|
protected proxyProcess?: ChildProcess;
|
|
19
|
-
protected readonly acceptHosts: string;
|
|
20
19
|
protected ready: boolean;
|
|
21
20
|
constructor(dependencies: Dependencies, cluster: Cluster, env: NodeJS.ProcessEnv);
|
|
22
21
|
get whenReady(): Promise<void> & {
|
|
@@ -13,5 +13,5 @@ interface Props extends SwitchProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated Use <Switch/> instead from "../switch.tsx".
|
|
15
15
|
*/
|
|
16
|
-
export declare const Switcher: React.ComponentType<Pick<Props, "name" | "id" | "title" | "value" | "size" | "key" | "prefix" | "defaultValue" | "form" | "slot" | "style" | "className" | "color" | "ref" | "action" | "autoFocus" | "checked" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "placeholder" | "readOnly" | "required" | "type" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "
|
|
16
|
+
export declare const Switcher: React.ComponentType<Pick<Props, "name" | "id" | "title" | "value" | "size" | "key" | "prefix" | "defaultValue" | "form" | "slot" | "style" | "hidden" | "className" | "color" | "ref" | "action" | "autoFocus" | "checked" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "placeholder" | "readOnly" | "required" | "type" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "icon" | "inputProps" | "innerRef" | "checkedIcon" | "disableFocusRipple" | "edge" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "inputRef"> & import("@material-ui/core/styles").StyledComponentProps<"track" | "checked" | "root" | "switchBase" | "thumb" | "focusVisible">>;
|
|
17
17
|
export {};
|
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": "5.4.0-git.
|
|
5
|
+
"version": "5.4.0-git.c04a3b8d33.0",
|
|
6
6
|
"copyright": "© 2021 OpenLens Authors",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/src/extensions/extension-api.js",
|