1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Merge pull request #2389 from lensapp/release/v4.1.5

Release v4.1.5
This commit is contained in:
Jari Kolehmainen 2021-03-26 12:44:50 +02:00 committed by GitHub
commit 06d54eea9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 5 deletions

View File

@ -2,7 +2,7 @@
"name": "kontena-lens", "name": "kontena-lens",
"productName": "Lens", "productName": "Lens",
"description": "Lens - The Kubernetes IDE", "description": "Lens - The Kubernetes IDE",
"version": "4.1.4", "version": "4.1.5",
"main": "static/build/main.js", "main": "static/build/main.js",
"copyright": "© 2020, Mirantis, Inc.", "copyright": "© 2020, Mirantis, Inc.",
"license": "MIT", "license": "MIT",

View File

@ -192,6 +192,7 @@ export class ExtensionLoader {
registries.appPreferenceRegistry.add(extension.appPreferences), registries.appPreferenceRegistry.add(extension.appPreferences),
registries.clusterFeatureRegistry.add(extension.clusterFeatures), registries.clusterFeatureRegistry.add(extension.clusterFeatures),
registries.statusBarRegistry.add(extension.statusBarItems), registries.statusBarRegistry.add(extension.statusBarItems),
registries.commandRegistry.add(extension.commands),
]; ];
this.events.on("remove", (removedExtension: LensRendererExtension) => { this.events.on("remove", (removedExtension: LensRendererExtension) => {
@ -220,7 +221,8 @@ export class ExtensionLoader {
registries.clusterPageMenuRegistry.add(extension.clusterPageMenus, extension), registries.clusterPageMenuRegistry.add(extension.clusterPageMenus, extension),
registries.kubeObjectMenuRegistry.add(extension.kubeObjectMenuItems), registries.kubeObjectMenuRegistry.add(extension.kubeObjectMenuItems),
registries.kubeObjectDetailRegistry.add(extension.kubeObjectDetailItems), registries.kubeObjectDetailRegistry.add(extension.kubeObjectDetailItems),
registries.kubeObjectStatusRegistry.add(extension.kubeObjectStatusTexts) registries.kubeObjectStatusRegistry.add(extension.kubeObjectStatusTexts),
registries.commandRegistry.add(extension.commands),
]; ];
this.events.on("remove", (removedExtension: LensRendererExtension) => { this.events.on("remove", (removedExtension: LensRendererExtension) => {

View File

@ -9,3 +9,4 @@ export * from "./kube-object-detail-registry";
export * from "./kube-object-menu-registry"; export * from "./kube-object-menu-registry";
export * from "./cluster-feature-registry"; export * from "./cluster-feature-registry";
export * from "./kube-object-status-registry"; export * from "./kube-object-status-registry";
export * from "./command-registry";

View File

@ -0,0 +1,19 @@
/**
* @jest-environment jsdom
*/
import { clearKubeconfigEnvVars } from "../utils/clear-kube-env-vars";
describe("clearKubeconfigEnvVars tests", () => {
it("should not touch non kubeconfig keys", () => {
expect(clearKubeconfigEnvVars({ a: 1 })).toStrictEqual({ a: 1 });
});
it("should remove a single kubeconfig key", () => {
expect(clearKubeconfigEnvVars({ a: 1, kubeconfig: "1" })).toStrictEqual({ a: 1 });
});
it("should remove a two kubeconfig key", () => {
expect(clearKubeconfigEnvVars({ a: 1, kubeconfig: "1", kUbeconfig: "1" })).toStrictEqual({ a: 1 });
});
});

View File

@ -28,7 +28,7 @@ export class LensProxy {
} }
listen(port = this.port): this { listen(port = this.port): this {
this.proxyServer = this.buildCustomProxy().listen(port); this.proxyServer = this.buildCustomProxy().listen(port, "127.0.0.1");
logger.info(`[LENS-PROXY]: Proxy server has started at ${this.origin}`); logger.info(`[LENS-PROXY]: Proxy server has started at ${this.origin}`);
return this; return this;

View File

@ -11,6 +11,7 @@ import { helmCli } from "./helm/helm-cli";
import { isWindows } from "../common/vars"; import { isWindows } from "../common/vars";
import { appEventBus } from "../common/event-bus"; import { appEventBus } from "../common/event-bus";
import { userStore } from "../common/user-store"; import { userStore } from "../common/user-store";
import { clearKubeconfigEnvVars } from "./utils/clear-kube-env-vars";
export class ShellSession extends EventEmitter { export class ShellSession extends EventEmitter {
static shellEnvs: Map<string, any> = new Map(); static shellEnvs: Map<string, any> = new Map();
@ -103,7 +104,7 @@ export class ShellSession extends EventEmitter {
} }
protected async getShellEnv() { protected async getShellEnv() {
const env = JSON.parse(JSON.stringify(await shellEnv())); const env = clearKubeconfigEnvVars(JSON.parse(JSON.stringify(await shellEnv())));
const pathStr = [this.kubectlBinDir, this.helmBinDir, process.env.PATH].join(path.delimiter); const pathStr = [this.kubectlBinDir, this.helmBinDir, process.env.PATH].join(path.delimiter);
if(isWindows) { if(isWindows) {

View File

@ -0,0 +1,16 @@
const anyKubeconfig = /^kubeconfig$/i;
/**
* This function deletes all keys of the form /^kubeconfig$/i, returning a new
* object.
*
* This is needed because `kubectl` checks for other version of kubeconfig
* before KUBECONFIG and we only set KUBECONFIG.
* @param env The current copy of env
*/
export function clearKubeconfigEnvVars(env: Record<string, any>): Record<string, any> {
return Object.fromEntries(
Object.entries(env)
.filter(([key]) => anyKubeconfig.exec(key) === null)
);
}

View File

@ -2,7 +2,14 @@
Here you can find description of changes we've built into each release. While we try our best to make each upgrade automatic and as smooth as possible, there may be some cases where you might need to do something to ensure the application works smoothly. So please read through the release highlights! Here you can find description of changes we've built into each release. While we try our best to make each upgrade automatic and as smooth as possible, there may be some cases where you might need to do something to ensure the application works smoothly. So please read through the release highlights!
## 4.1.4 (current version)
## 4.1.5 (current version)
- Fix internal proxy listening on all network interfaces
- Fix extension command palette loading
- Fix Lens not clearing other KUBECONFIG env vars
## 4.1.4
- Ignore clusters with invalid kubeconfig - Ignore clusters with invalid kubeconfig
- Render only secret name on pod details without access to secrets - Render only secret name on pod details without access to secrets