diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 6bb07489ec..d7ed058fa3 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -58,6 +58,7 @@ jobs: - script: make test-extensions displayName: Run In-tree Extension tests - bash: | + set -e rm -rf extensions/telemetry make integration-win git checkout extensions/telemetry @@ -102,6 +103,7 @@ jobs: - script: make test-extensions displayName: Run In-tree Extension tests - bash: | + set -e rm -rf extensions/telemetry make integration-mac git checkout extensions/telemetry @@ -159,6 +161,7 @@ jobs: sudo chown -R $USER $HOME/.kube $HOME/.minikube displayName: Install integration test dependencies - bash: | + set -e rm -rf extensions/telemetry xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux git checkout extensions/telemetry diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 0000000000..a77a36c653 --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,17 @@ +# See https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates +# for config options + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 4 + reviewers: + - "lensapp/lens-maintainers" + labels: + - "dependencies" + versioning-strategy: + lockfile-only: false + increase: true diff --git a/.eslintrc.js b/.eslintrc.js index 3fd52c2465..57ee07348f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,6 +46,8 @@ module.exports = { "avoidEscape": true, "allowTemplateLiterals": true, }], + "linebreak-style": ["error", "unix"], + "eol-last": ["error", "always"], "semi": ["error", "always"], "object-shorthand": "error", "prefer-template": "error", @@ -101,6 +103,8 @@ module.exports = { }], "semi": "off", "@typescript-eslint/semi": ["error"], + "linebreak-style": ["error", "unix"], + "eol-last": ["error", "always"], "object-shorthand": "error", "prefer-template": "error", "template-curly-spacing": "error", @@ -162,6 +166,8 @@ module.exports = { }], "semi": "off", "@typescript-eslint/semi": ["error"], + "linebreak-style": ["error", "unix"], + "eol-last": ["error", "always"], "object-shorthand": "error", "prefer-template": "error", "template-curly-spacing": "error", diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000000..02ae36727e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,30 @@ +exclude-labels: + - 'skip-changelog' +categories: + - title: '🚀 Features' + labels: + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'chore' + - 'area/ci' + - 'area/tests' + - 'dependencies' + +template: | + ## Changes since $PREVIOUS_TAG + + $CHANGES + + ### Download + + - Lens v$RESOLVED_VERSION - Linux + - [AppImage](https://github.com/lensapp/lens/releases/download/v$RESOLVED_VERSION/Lens-$RESOLVED_VERSION.x86_64.AppImage) + - [DEB](https://github.com/lensapp/lens/releases/download/v$RESOLVED_VERSION/Lens-$RESOLVED_VERSION.amd64.deb) + - [RPM](https://github.com/lensapp/lens/releases/download/v$RESOLVED_VERSION/Lens-$RESOLVED_VERSION.x86_64.rpm) + - [Snapcraft](https://snapcraft.io/kontena-lens) + - [Lens v$RESOLVED_VERSION - MacOS](https://github.com/lensapp/lens/releases/download/v$RESOLVED_VERSION/Lens-$RESOLVED_VERSION.dmg) + - [Lens v$RESOLVED_VERSION - Windows](https://github.com/lensapp/lens/releases/download/v$RESOLVED_VERSION/Lens-Setup-$RESOLVED_VERSION.exe) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000000..ec49fec6e5 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,16 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/Makefile b/Makefile index 362ef3b830..000682e039 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ endif binaries/client: yarn download-bins -node_modules: +node_modules: yarn.lock yarn install --frozen-lockfile yarn check --verify-tree --integrity diff --git a/__mocks__/imageMock.ts b/__mocks__/imageMock.ts index a099545376..f053ebf797 100644 --- a/__mocks__/imageMock.ts +++ b/__mocks__/imageMock.ts @@ -1 +1 @@ -module.exports = {}; \ No newline at end of file +module.exports = {}; diff --git a/__mocks__/styleMock.ts b/__mocks__/styleMock.ts index a099545376..f053ebf797 100644 --- a/__mocks__/styleMock.ts +++ b/__mocks__/styleMock.ts @@ -1 +1 @@ -module.exports = {}; \ No newline at end of file +module.exports = {}; diff --git a/build/icons/512x512.png b/build/icons/512x512.png index 2c953f6efd..e08b9f5b15 100644 Binary files a/build/icons/512x512.png and b/build/icons/512x512.png differ diff --git a/build/icons/512x512@2x.png b/build/icons/512x512@2x.png new file mode 100644 index 0000000000..da0aa8ae80 Binary files /dev/null and b/build/icons/512x512@2x.png differ diff --git a/docs/extensions/capabilities/color-reference.md b/docs/extensions/capabilities/color-reference.md index 660e0fe067..6a38ba861c 100644 --- a/docs/extensions/capabilities/color-reference.md +++ b/docs/extensions/capabilities/color-reference.md @@ -43,6 +43,7 @@ You can use theme-based CSS Variables to style an extension according to the act ## Button Colors - `--buttonPrimaryBackground`: button background color for primary actions. - `--buttonDefaultBackground`: default button background color. +- `--buttonLightBackground`: light button background color. - `--buttonAccentBackground`: accent button background color. - `--buttonDisabledBackground`: disabled button background color. diff --git a/docs/extensions/capabilities/common-capabilities.md b/docs/extensions/capabilities/common-capabilities.md index 6fdb87db82..1410dfc148 100644 --- a/docs/extensions/capabilities/common-capabilities.md +++ b/docs/extensions/capabilities/common-capabilities.md @@ -40,7 +40,7 @@ This extension can register custom app menus that will be displayed on OS native Example: -``` typescript +```typescript import { LensMainExtension, windowManager } from "@k8slens/extensions" export default class ExampleMainExtension extends LensMainExtension { @@ -92,7 +92,7 @@ export default class ExampleMainExtension extends LensRendererExtension { This extension can register custom global pages (views) to Lens's main window. The global page is a full-screen page that hides all other content from a window. -``` typescript +```typescript import React from "react" import { Component, LensRendererExtension } from "@k8slens/extensions" import { ExamplePage } from "./src/example-page" @@ -123,7 +123,7 @@ export default class ExampleRendererExtension extends LensRendererExtension { This extension can register custom app preferences. It is responsible for storing a state for custom preferences. -``` typescript +```typescript import React from "react" import { LensRendererExtension } from "@k8slens/extensions" import { myCustomPreferencesStore } from "./src/my-custom-preferences-store" @@ -147,7 +147,7 @@ export default class ExampleRendererExtension extends LensRendererExtension { This extension can register custom cluster pages. These pages are visible in a cluster menu when a cluster is opened. -``` typescript +```typescript import React from "react" import { LensRendererExtension } from "@k8slens/extensions"; import { ExampleIcon, ExamplePage } from "./src/page" @@ -180,7 +180,7 @@ export default class ExampleExtension extends LensRendererExtension { This extension can register installable features for a cluster. These features are visible in the "Cluster Settings" page. -``` typescript +```typescript import React from "react" import { LensRendererExtension } from "@k8slens/extensions" import { MyCustomFeature } from "./src/my-custom-feature" @@ -209,18 +209,20 @@ export default class ExampleExtension extends LensRendererExtension { This extension can register custom icons and text to a status bar area. -``` typescript +```typescript import React from "react"; import { Component, LensRendererExtension, Navigation } from "@k8slens/extensions"; export default class ExampleExtension extends LensRendererExtension { statusBarItems = [ { - item: ( -
(pageId?: string, params?: P) {
const { navigate } = await import("../renderer/navigation");
diff --git a/src/extensions/registries/command-registry.ts b/src/extensions/registries/command-registry.ts
new file mode 100644
index 0000000000..0b1fc0252c
--- /dev/null
+++ b/src/extensions/registries/command-registry.ts
@@ -0,0 +1,37 @@
+// Extensions API -> Commands
+
+import type { Cluster } from "../../main/cluster";
+import type { Workspace } from "../../common/workspace-store";
+import { BaseRegistry } from "./base-registry";
+import { action } from "mobx";
+import { LensExtension } from "../lens-extension";
+
+export type CommandContext = {
+ cluster?: Cluster;
+ workspace?: Workspace;
+};
+
+export interface CommandRegistration {
+ id: string;
+ title: string;
+ scope: "cluster" | "global";
+ action: (context: CommandContext) => void;
+ isActive?: (context: CommandContext) => boolean;
+}
+
+export class CommandRegistry extends BaseRegistry
- Define cluster{" "}
-
- workspace
- .
+ Define cluster workspace.
(api: string | KubeApi): S {
- return this.stores.get(this.resolveApi(api)) as S;
+ return this.stores.get(this.resolveApi(api)?.apiBase) as S;
}
}
diff --git a/src/renderer/api/endpoints/helm-charts.api.ts b/src/renderer/api/endpoints/helm-charts.api.ts
index a1fd497798..8beff01779 100644
--- a/src/renderer/api/endpoints/helm-charts.api.ts
+++ b/src/renderer/api/endpoints/helm-charts.api.ts
@@ -86,7 +86,7 @@ export class HelmChart {
tillerVersion?: string;
getId() {
- return this.digest;
+ return `${this.apiVersion}/${this.name}@${this.getAppVersion()}`;
}
getName() {
diff --git a/src/renderer/api/endpoints/helm-releases.api.ts b/src/renderer/api/endpoints/helm-releases.api.ts
index 84e095721b..6831c508cb 100644
--- a/src/renderer/api/endpoints/helm-releases.api.ts
+++ b/src/renderer/api/endpoints/helm-releases.api.ts
@@ -57,6 +57,7 @@ export interface IReleaseRevision {
updated: string;
status: string;
chart: string;
+ app_version: string;
description: string;
}
diff --git a/src/renderer/api/endpoints/pods.api.ts b/src/renderer/api/endpoints/pods.api.ts
index eca15251a7..3176cae4d2 100644
--- a/src/renderer/api/endpoints/pods.api.ts
+++ b/src/renderer/api/endpoints/pods.api.ts
@@ -104,6 +104,9 @@ export interface IPodContainer {
configMapRef?: {
name: string;
};
+ secretRef?: {
+ name: string;
+ }
}[];
volumeMounts?: {
name: string;
diff --git a/src/renderer/api/json-api.ts b/src/renderer/api/json-api.ts
index 49c2cb1a28..124248bb67 100644
--- a/src/renderer/api/json-api.ts
+++ b/src/renderer/api/json-api.ts
@@ -3,7 +3,6 @@
import { stringify } from "querystring";
import { EventEmitter } from "../../common/event-emitter";
import { cancelableFetch } from "../utils/cancelableFetch";
-
export interface JsonApiData {
}
@@ -55,6 +54,34 @@ export class JsonApi