diff --git a/.npmrc b/.npmrc index 933095761e..ff651875bf 100644 --- a/.npmrc +++ b/.npmrc @@ -3,8 +3,8 @@ audit = false fund = false update-notifier = true # Lock versions of node and npm, when looking up engines. -node-version = 18.16.0 -npm-version = 9.5.1 +node-version = 18.17.0 +npm-version = 9.6.7 # Default options for package-lock - package-lock=true package-lock-only=false # If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true. # When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. diff --git a/.nvmrc b/.nvmrc index 6d80269a4f..603606bc91 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.16.0 +18.17.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 100ff5f77a..72dcf5d180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [2.4.2](https://github.com/kubeshop/monokle/compare/v2.4.2-nightly-2023-10-23.0...v2.4.2) (2023-10-23) + + +### Bug Fixes + +* remove old monokle cli ([140b428](https://github.com/kubeshop/monokle/commit/140b4280fd7d502a976357a903797a4d7553bb4c)) +* typo ([c0bd910](https://github.com/kubeshop/monokle/commit/c0bd9107ea0485b58049e5185cca1432b3f9039c)) +* values and dry run config selections ([c903c38](https://github.com/kubeshop/monokle/commit/c903c385c3032e70317b807750ed9d5754be56d2)) + ### [2.4.1](https://github.com/kubeshop/monokle/compare/v2.4.1-nightly-2023-10-11.0...v2.4.1) (2023-10-11) diff --git a/electron/app/services/cluster/utils/getDefaultKubeConfig.ts b/electron/app/services/cluster/utils/getDefaultKubeConfig.ts index 3bea5ee6b0..060ea22d97 100644 --- a/electron/app/services/cluster/utils/getDefaultKubeConfig.ts +++ b/electron/app/services/cluster/utils/getDefaultKubeConfig.ts @@ -18,5 +18,5 @@ export function getDefaultKubeConfig() { export function getEnvKubeconfigs(): string[] { const kubeconfig = getDefaultKubeConfig(); - return kubeconfig.split(':'); + return kubeconfig.split(path.delimiter); } diff --git a/package-lock.json b/package-lock.json index 560c69bb4e..e4e4a9d093 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "monokle", - "version": "2.4.1", + "version": "2.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "monokle", - "version": "2.4.1", + "version": "2.4.2", "hasInstallScript": true, "dependencies": { "@ant-design/icons": "4.8.0", "@dnd-kit/core": "6.0.8", "@dnd-kit/sortable": "7.0.2", - "@kubernetes/client-node": "0.18.1", + "@kubernetes/client-node": "0.19.0", "@monokle/components": "1.7.0", "@monokle/synchronizer": "^0.6.0", - "@monokle/validation": "0.24.2", + "@monokle/validation": "0.31.5", "@open-policy-agent/opa-wasm": "1.8.0", "@reduxjs/toolkit": "1.9.5", "@rjsf/antd": "5.8.1", @@ -104,7 +104,7 @@ "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", "@testing-library/user-event": "14.4.3", - "@trivago/prettier-plugin-sort-imports": "4.1.1", + "@trivago/prettier-plugin-sort-imports": "4.2.1", "@types/analytics-node": "3.1.11", "@types/async": "3.2.20", "@types/electron-devtools-installer": "2.2.4", @@ -338,27 +338,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/core/node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/core/node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -414,6 +393,7 @@ "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, "dependencies": { "@babel/types": "^7.17.0", "jsesc": "^2.5.1", @@ -776,42 +756,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helpers/node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers/node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/highlight": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", @@ -2413,18 +2357,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2432,6 +2376,20 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "dependencies": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/types": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", @@ -5323,7 +5281,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -5337,7 +5294,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -5346,7 +5302,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -5364,14 +5319,12 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.20", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -5384,12 +5337,12 @@ "dev": true }, "node_modules/@kubernetes/client-node": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.18.1.tgz", - "integrity": "sha512-F3JiK9iZnbh81O/da1tD0h8fQMi/MDttWc/JydyUVnjPEom55wVfnpl4zQ/sWD4uKB8FlxYRPiLwV2ZXB+xPKw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.19.0.tgz", + "integrity": "sha512-WTOjGuFQ8yeW3+qD6JrAYhpwpoQbe9R8cA/61WCyFrNawSTUgLstHu7EsZRYEs39er3jDn3wCEaczz+VOFlc2Q==", "dependencies": { "@types/js-yaml": "^4.0.1", - "@types/node": "^18.11.17", + "@types/node": "^20.1.1", "@types/request": "^2.47.1", "@types/ws": "^8.5.3", "byline": "^5.0.0", @@ -5400,20 +5353,13 @@ "rfc4648": "^1.3.0", "stream-buffers": "^3.0.2", "tar": "^6.1.11", - "tmp-promise": "^3.0.2", "tslib": "^2.4.1", - "underscore": "^1.13.6", "ws": "^8.11.0" }, "optionalDependencies": { "openid-client": "^5.3.0" } }, - "node_modules/@kubernetes/client-node/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==" - }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -5570,20 +5516,23 @@ "integrity": "sha512-IkbVrLOXZ38TZUfCYDp8XVVskvsLYftFb7ZXSn3PlxtIVbBVUIexqSm5erJ5ZK400f6yACCK+4qGzkPAJ43FVw==" }, "node_modules/@monokle/validation": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@monokle/validation/-/validation-0.24.2.tgz", - "integrity": "sha512-P5MTSi1NMxrGJ/23XbZxuwcviOSP9wuXPqhkk3Z3Av7/vPTMCFmQMj86kSdHRGKzdSPxS/M86bR+g13+lBdlKg==", + "version": "0.31.5", + "resolved": "https://registry.npmjs.org/@monokle/validation/-/validation-0.31.5.tgz", + "integrity": "sha512-Mp9pzNLt8+EE/xYJb/YbJiRFmIUnhP9hkFdo+5XhhhkmiFN3BhQauFkgSaSj6W/pEBSCzo7rYLxToKdRDED0iQ==", "dependencies": { + "@monokle/types": "*", "@open-policy-agent/opa-wasm": "1.8.0", "@rollup/plugin-virtual": "3.0.1", "ajv": "6.12.6", "change-case": "4.1.2", + "get-random-values": "^3.0.0", "isomorphic-fetch": "3.0.0", "lodash": "4.17.21", "node-fetch": "3.3.0", - "react-fast-compare": "3.2.1", + "pako": "^2.1.0", "require-from-string": "2.0.2", "rollup": "3.18.0", + "uuid": "9.0.0", "yaml": "2.2.2", "zod": "3.19.1" } @@ -5625,10 +5574,10 @@ "url": "https://opencollective.com/node-fetch" } }, - "node_modules/@monokle/validation/node_modules/react-fast-compare": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.1.tgz", - "integrity": "sha512-xTYf9zFim2pEif/Fw16dBiXpe0hoy5PxcD8+OwBnTtNLfIm3g6WxhKNurY+6OmdH1u6Ta/W/Vl6vjbYP1MFnDg==" + "node_modules/@monokle/validation/node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", @@ -6834,21 +6783,21 @@ } }, "node_modules/@trivago/prettier-plugin-sort-imports": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.1.1.tgz", - "integrity": "sha512-dQ2r2uzNr1x6pJsuh/8x0IRA3CBUB+pWEW3J/7N98axqt7SQSm+2fy0FLNXvXGg77xEDC7KHxJlHfLYyi7PDcw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.1.tgz", + "integrity": "sha512-iuy2MPVURGdxILTchHr15VAioItuYBejKfcTmQFlxIuqA7jeaT6ngr5aUIG6S6U096d6a6lJCgaOwlRrPLlOPg==", "dev": true, "dependencies": { "@babel/generator": "7.17.7", "@babel/parser": "^7.20.5", - "@babel/traverse": "7.17.3", + "@babel/traverse": "7.23.2", "@babel/types": "7.17.0", "javascript-natural-sort": "0.7.1", "lodash": "^4.17.21" }, "peerDependencies": { "@vue/compiler-sfc": "3.x", - "prettier": "2.x" + "prettier": "2.x - 3.x" }, "peerDependenciesMeta": { "@vue/compiler-sfc": { @@ -12990,6 +12939,11 @@ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, + "node_modules/dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" + }, "node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", @@ -15966,6 +15920,17 @@ "node": ">=10" } }, + "node_modules/get-random-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-random-values/-/get-random-values-3.0.0.tgz", + "integrity": "sha512-mNznaBdYcpz7UAdnOtDGcLdNwAa79mXl5htEyyZ51YaeAWNf2g4x/2yCVBdNNTbi35wX0Stc2PJXM7G6rcONOA==", + "dependencies": { + "global": "^4.4.0" + }, + "engines": { + "node": "18 || >=20" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -16141,6 +16106,15 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, + "node_modules/global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "dependencies": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, "node_modules/global-agent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", @@ -24146,6 +24120,14 @@ "node": ">=4" } }, + "node_modules/min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==", + "dependencies": { + "dom-walk": "^0.1.0" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -27256,6 +27238,14 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -30274,6 +30264,7 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -32277,6 +32268,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", + "dev": true, "dependencies": { "tmp": "^0.2.0" } @@ -32285,6 +32277,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -32773,11 +32766,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index b368e01983..5ff9846f40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monokle", - "version": "2.4.1", + "version": "2.4.2", "author": "Kubeshop", "description": "UI for managing k8s manifests", "homepage": "./", @@ -32,7 +32,7 @@ "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", "@testing-library/user-event": "14.4.3", - "@trivago/prettier-plugin-sort-imports": "4.1.1", + "@trivago/prettier-plugin-sort-imports": "4.2.1", "@types/analytics-node": "3.1.11", "@types/async": "3.2.20", "@types/electron-devtools-installer": "2.2.4", @@ -99,10 +99,10 @@ "@ant-design/icons": "4.8.0", "@dnd-kit/core": "6.0.8", "@dnd-kit/sortable": "7.0.2", - "@kubernetes/client-node": "0.18.1", + "@kubernetes/client-node": "0.19.0", "@monokle/components": "1.7.0", "@monokle/synchronizer": "^0.6.0", - "@monokle/validation": "0.24.2", + "@monokle/validation": "0.31.5", "@open-policy-agent/opa-wasm": "1.8.0", "@reduxjs/toolkit": "1.9.5", "@rjsf/antd": "5.8.1", diff --git a/src/components/organisms/NewResourceWizard/NewResourceWizard.tsx b/src/components/organisms/NewResourceWizard/NewResourceWizard.tsx index 687ec57438..5440fffc30 100644 --- a/src/components/organisms/NewResourceWizard/NewResourceWizard.tsx +++ b/src/components/organisms/NewResourceWizard/NewResourceWizard.tsx @@ -90,7 +90,7 @@ const NewResourceWizard = () => { const fileMapRef = useRefSelector(state => state.main.fileMap); const [rootFolderEntry, rootFolderEntryRef] = useSelectorWithRef(state => state.main.fileMap[ROOT_FILE_ENTRY]); const userDataDirRef = useRefSelector(state => state.config.userDataDir); - const k8sVersionRef = useRefSelector(state => state.config.k8sVersion); + const k8sVersionRef = useRefSelector(state => state.config.projectConfig?.k8sVersion || state.config.k8sVersion); const [filteredResources, setFilteredResources] = useState([]); const [inputValue, setInputValue] = useState(''); diff --git a/src/components/organisms/SettingsPane/GlobalSettings/GlobalSettings.tsx b/src/components/organisms/SettingsPane/GlobalSettings/GlobalSettings.tsx index 74039eb4ef..cc8d66db9f 100644 --- a/src/components/organisms/SettingsPane/GlobalSettings/GlobalSettings.tsx +++ b/src/components/organisms/SettingsPane/GlobalSettings/GlobalSettings.tsx @@ -48,6 +48,40 @@ export const GlobalSettings = () => { [_setShouldAppendServerPath] ); + const [isOverridingBinaryPaths, _setIsOverridingBinaryPaths] = useState( + Boolean(electronStore.get('appConfig.binaryPaths')) ?? false + ); + + const setIsOverridingBinaryPaths = useCallback( + (value: boolean) => { + _setIsOverridingBinaryPaths(value); + electronStore.set('appConfig.binaryPaths', value === false ? null : {}); + }, + [_setIsOverridingBinaryPaths] + ); + + const [kubectlBinaryPath, _setKubectlBinaryPath] = useState( + electronStore.get('appConfig.binaryPaths.kubectl') ?? '' + ); + + const setKubectlBinaryPath = useCallback( + (value: string) => { + _setKubectlBinaryPath(value); + electronStore.set('appConfig.binaryPaths.kubectl', value); + }, + [_setKubectlBinaryPath] + ); + + const [helmBinaryPath, _setHelmBinaryPath] = useState(electronStore.get('appConfig.binaryPaths.helm') ?? ''); + + const setHelmBinaryPath = useCallback( + (value: string) => { + _setHelmBinaryPath(value); + electronStore.set('appConfig.binaryPaths.helm', value); + }, + [_setHelmBinaryPath] + ); + const [currentProjectsRootPath, setCurrentProjectsRootPath] = useState(projectsRootPath); const [settingsForm] = useForm(); @@ -159,6 +193,23 @@ export const GlobalSettings = () => { Append Server Path to Kubectl Proxy + + + Binary Configuration + setIsOverridingBinaryPaths(e.target.checked)}> + Override binary paths + + {isOverridingBinaryPaths && ( + <> + + setKubectlBinaryPath(e.target.value)} /> + + + setHelmBinaryPath(e.target.value)} /> + + + )} +
diff --git a/src/editor/listeners/editorSelection.listener.ts b/src/editor/listeners/editorSelection.listener.ts index 158ee53120..e1a36b9cd2 100644 --- a/src/editor/listeners/editorSelection.listener.ts +++ b/src/editor/listeners/editorSelection.listener.ts @@ -101,7 +101,7 @@ export const editorSelectionListener: AppListenerFn = listen => { }; const enableResourceSchemaValidation = (resourceMeta: ResourceMeta, state: RootState) => { - const k8sVersion = state.config.k8sVersion; + const k8sVersion = state.config.projectConfig?.k8sVersion || state.config.k8sVersion; const userDataDir = state.config.userDataDir; if (!userDataDir) { diff --git a/src/kindhandlers/ValidatingAdmissionPolicy.handler.ts b/src/kindhandlers/ValidatingAdmissionPolicy.handler.ts new file mode 100644 index 0000000000..0a6597e860 --- /dev/null +++ b/src/kindhandlers/ValidatingAdmissionPolicy.handler.ts @@ -0,0 +1,35 @@ +import * as k8s from '@kubernetes/client-node'; + +import navSectionNames from '@constants/navSectionNames'; + +import {ResourceMeta} from '@shared/models/k8sResource'; +import {ResourceKindHandler} from '@shared/models/resourceKindHandler'; + +const ValidatingAdmissionPolicyHandler: ResourceKindHandler = { + kind: 'ValidatingAdmissionPolicy', + apiVersionMatcher: '**', + isNamespaced: false, + navigatorPath: [navSectionNames.K8S_RESOURCES, navSectionNames.CONFIGURATION, 'ValidatingAdmissionPolicies'], + clusterApiVersion: 'admissionregistration.k8s.io/v1beta1', + validationSchemaPrefix: 'io.k8s.api.admissionregistration.v1beta1', + isCustom: false, + getResourceFromCluster(kubeconfig: k8s.KubeConfig, resource: ResourceMeta) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + return k8sAdmissionregistrationV1alpha1Api.readValidatingAdmissionPolicy(resource.name); + }, + async listResourcesInCluster(kubeconfig: k8s.KubeConfig) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + const response = await k8sAdmissionregistrationV1alpha1Api.listValidatingAdmissionPolicy(); + return response.body.items || []; + }, + async deleteResourceInCluster(kubeconfig: k8s.KubeConfig, resource: ResourceMeta) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + await k8sAdmissionregistrationV1alpha1Api.deleteValidatingAdmissionPolicy(resource.name); + }, + helpLink: 'https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/', +}; + +export default ValidatingAdmissionPolicyHandler; diff --git a/src/kindhandlers/ValidatingAdmissionPolicyBinding.handler.ts b/src/kindhandlers/ValidatingAdmissionPolicyBinding.handler.ts new file mode 100644 index 0000000000..00600e18c0 --- /dev/null +++ b/src/kindhandlers/ValidatingAdmissionPolicyBinding.handler.ts @@ -0,0 +1,35 @@ +import * as k8s from '@kubernetes/client-node'; + +import navSectionNames from '@constants/navSectionNames'; + +import {ResourceMeta} from '@shared/models/k8sResource'; +import {ResourceKindHandler} from '@shared/models/resourceKindHandler'; + +const ValidatingAdmissionPolicyHandler: ResourceKindHandler = { + kind: 'ValidatingAdmissionPolicyBinding', + apiVersionMatcher: '**', + isNamespaced: false, + navigatorPath: [navSectionNames.K8S_RESOURCES, navSectionNames.CONFIGURATION, 'ValidatingAdmissionPolicyBindings'], + clusterApiVersion: 'admissionregistration.k8s.io/v1beta1', + validationSchemaPrefix: 'io.k8s.api.admissionregistration.v1beta1', + isCustom: false, + getResourceFromCluster(kubeconfig: k8s.KubeConfig, resource: ResourceMeta) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + return k8sAdmissionregistrationV1alpha1Api.readValidatingAdmissionPolicyBinding(resource.name); + }, + async listResourcesInCluster(kubeconfig: k8s.KubeConfig) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + const response = await k8sAdmissionregistrationV1alpha1Api.listValidatingAdmissionPolicyBinding(); + return response.body.items || []; + }, + async deleteResourceInCluster(kubeconfig: k8s.KubeConfig, resource: ResourceMeta) { + const k8sAdmissionregistrationV1alpha1Api = kubeconfig.makeApiClient(k8s.AdmissionregistrationV1alpha1Api); + k8sAdmissionregistrationV1alpha1Api.setDefaultAuthentication(new k8s.VoidAuth()); + await k8sAdmissionregistrationV1alpha1Api.deleteValidatingAdmissionPolicyBinding(resource.name); + }, + helpLink: 'https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/', +}; + +export default ValidatingAdmissionPolicyHandler; diff --git a/src/kindhandlers/index.ts b/src/kindhandlers/index.ts index de8500b412..872e8a7aff 100644 --- a/src/kindhandlers/index.ts +++ b/src/kindhandlers/index.ts @@ -12,6 +12,8 @@ import HorizontalPodAutoscalerHandler from '@src/kindhandlers/HorizontalPodAutos import LimitRangeHandler from '@src/kindhandlers/LimitRange.handler'; import ResourceQuotaHandler from '@src/kindhandlers/ResourceQuota.handler'; import StorageClassHandler from '@src/kindhandlers/StorageClass.handler'; +import ValidatingAdmissionPolicyHandler from '@src/kindhandlers/ValidatingAdmissionPolicy.handler'; +import ValidatingAdmissionPolicyBindingHandler from '@src/kindhandlers/ValidatingAdmissionPolicyBinding.handler'; import VolumeAttachmentHandler from '@src/kindhandlers/VolumeAttachment.handler'; import {extractKindHandler} from '@src/kindhandlers/common/customObjectKindHandler'; @@ -83,6 +85,8 @@ export const ResourceKindHandlers: ResourceKindHandler[] = [ HorizontalPodAutoscalerHandler, NodeHandler, EventHandler, + ValidatingAdmissionPolicyHandler, + ValidatingAdmissionPolicyBindingHandler, ]; const HandlerByResourceKind = Object.fromEntries( diff --git a/src/redux/cluster/selectors.ts b/src/redux/cluster/selectors.ts index 8c618ba8dd..7f35de3461 100644 --- a/src/redux/cluster/selectors.ts +++ b/src/redux/cluster/selectors.ts @@ -3,6 +3,7 @@ import {Context} from '@kubernetes/client-node'; import {TypedUseSelectorHook} from 'react-redux'; import {uniq} from 'lodash'; +import path from 'path'; import {createSelector} from 'reselect'; import {useAppSelector} from '@redux/hooks'; @@ -31,8 +32,8 @@ export const selectKubeconfigPaths = (state: RootState): string[] => { allConfigs .map(config => { // KUBECONFIG ENV VAR can contain multiple paths separated by ':' - if (config.includes(':')) { - return config.split(':'); + if (config.includes(path.delimiter)) { + return config.split(path.delimiter); } return config; }) diff --git a/src/redux/validation/validation.loader.ts b/src/redux/validation/validation.loader.ts deleted file mode 100644 index 1fd87d33a4..0000000000 --- a/src/redux/validation/validation.loader.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {CustomPluginLoader, SimpleCustomValidator, fetchBundleRequireCustomPlugin} from '@monokle/validation'; - -export const validationCustomPluginLoader: CustomPluginLoader = async (pluginName, parser) => { - const customPlugin = await fetchBundleRequireCustomPlugin(pluginName); - return new SimpleCustomValidator(customPlugin, parser); -}; diff --git a/src/redux/validation/validation.worker.ts b/src/redux/validation/validation.worker.ts index 7d929f2747..b5b91c69eb 100644 --- a/src/redux/validation/validation.worker.ts +++ b/src/redux/validation/validation.worker.ts @@ -1,9 +1,8 @@ /// import {WorkerMessage, matchWorkerEvent} from '@utils/worker'; -import {ResourceParser, SchemaLoader, createExtensibleMonokleValidator} from '@monokle/validation'; +import {createDefaultMonokleValidator} from '@monokle/validation'; -import {validationCustomPluginLoader} from './validation.loader'; import { LoadValidationMessage, LoadValidationMessageType, @@ -13,9 +12,7 @@ import { RunValidationMessageType, } from './validation.worker.types'; -const RESOURCE_PARSER = new ResourceParser(); -const SCHEMA_LOADER = new SchemaLoader(); -const VALIDATOR = createExtensibleMonokleValidator(RESOURCE_PARSER, SCHEMA_LOADER, validationCustomPluginLoader); +const VALIDATOR = createDefaultMonokleValidator(); const handleEvent = ( event: MessageEvent, diff --git a/src/redux/validation/validator.ts b/src/redux/validation/validator.ts index 65d9ad0dbb..307171f890 100644 --- a/src/redux/validation/validator.ts +++ b/src/redux/validation/validator.ts @@ -1,12 +1,9 @@ import log from 'loglevel'; -import {RESOURCE_PARSER} from '@redux/parsing/resourceParser'; - import {createWorkerEventPromise} from '@utils/worker'; -import {CustomSchema, MonokleValidator, SchemaLoader, createExtensibleMonokleValidator} from '@monokle/validation'; +import {CustomSchema, MonokleValidator, SchemaLoader, createDefaultMonokleValidator} from '@monokle/validation'; -import {validationCustomPluginLoader} from './validation.loader'; import { LoadValidationMessage, LoadValidationMessageType, @@ -24,11 +21,7 @@ class ValidationWorker { constructor() { this.#worker = new Worker(new URL('./validation.worker', import.meta.url)); - this.#validator = createExtensibleMonokleValidator( - RESOURCE_PARSER.getParser(), - SCHEMA_LOADER, - validationCustomPluginLoader - ); + this.#validator = createDefaultMonokleValidator(); } get metadata() { @@ -73,10 +66,6 @@ class ValidationWorker { }); } - isRuleEnabled(rule: string) { - return this.#validator.isRuleEnabled(rule); - } - getPlugin(name: string) { return this.#validator.getPlugin(name); } diff --git a/src/shared/constants/electronStore.ts b/src/shared/constants/electronStore.ts index d6ab6b75fb..787d234688 100644 --- a/src/shared/constants/electronStore.ts +++ b/src/shared/constants/electronStore.ts @@ -26,6 +26,17 @@ export const electronStoreSchema = { appConfig: { type: 'object', properties: { + binaryPaths: { + type: ['object', 'null'], + properties: { + kubectl: { + type: 'string', + }, + helm: { + type: 'string', + }, + }, + }, userApiKeys: { type: 'object', properties: { diff --git a/src/shared/constants/k8s.ts b/src/shared/constants/k8s.ts index 3d311fdf8b..ac302bdc96 100644 --- a/src/shared/constants/k8s.ts +++ b/src/shared/constants/k8s.ts @@ -1,11 +1,37 @@ export const PREDEFINED_K8S_VERSION = '1.26.3'; export const K8S_VERSIONS = [ + '1.28.3', + '1.28.2', + '1.28.1', + '1.28.0', + '1.27.7', + '1.27.6', + '1.27.5', + '1.27.4', + '1.27.3', + '1.27.2', + '1.27.1', '1.27.0', + '1.26.10', + '1.26.9', + '1.26.8', + '1.26.7', + '1.26.6', + '1.26.5', + '1.26.4', '1.26.3', '1.26.2', '1.26.1', '1.26.0', + '1.25.15', + '1.25.14', + '1.25.13', + '1.25.12', + '1.25.11', + '1.25.10', + '1.25.9', + '1.25.8', '1.25.7', '1.25.6', '1.25.5', diff --git a/src/shared/utils/commands/execute.ts b/src/shared/utils/commands/execute.ts index 3dd8d1eb2d..8c73556a31 100644 --- a/src/shared/utils/commands/execute.ts +++ b/src/shared/utils/commands/execute.ts @@ -7,10 +7,22 @@ import {CommandOptions, CommandResult} from '@shared/models/commands'; import {isDefined} from '@shared/utils/filter'; import {ensureRendererThread} from '@shared/utils/thread'; +import electronStore from '../electronStore'; + export function runCommandInMainThread(options: CommandOptions): Promise { ensureRendererThread(); log.info('sending command to main thread', options); + const binaryPaths = electronStore.get('appConfig.binaryPaths'); + if (binaryPaths) { + if (typeof binaryPaths.kubectl === 'string' && options.cmd.startsWith('kubectl')) { + options.cmd = options.cmd.replace('kubectl', binaryPaths.kubectl); + } + if (typeof binaryPaths.helm === 'string' && options.cmd.startsWith('helm')) { + options.cmd = options.cmd.replace('helm', binaryPaths.helm); + } + } + return new Promise(resolve => { const cb = (_event: unknown, arg: CommandResult) => { if (arg.commandId !== options.commandId) return;