Merge branch 'master' into show-extension-preferences-in-separate-page

This commit is contained in:
Alex Andreev committed 2022-06-10 10:51:08 +03:00
commit 5023c7e47f
5 files changed
+41 -27

No files matched your search

@@ -10,7 +10,14 @@ import type { DerivedKubeApiOptions, IgnoredKubeApiOptions } from "../kube-api";
import { KubeApi } from "../kube-api";
export class ClusterApi extends KubeApi<Cluster> {
/**
* @deprecated This field is legacy and never used.
*/
static kind = "Cluster";
/**
* @deprecated This field is legacy and never used.
*/
static namespaced = true;
constructor(opts: DerivedKubeApiOptions & IgnoredKubeApiOptions = {}) {
@@ -104,6 +111,7 @@ export interface Cluster {
export class Cluster extends KubeObject {
static kind = "Cluster";
static apiBase = "/apis/cluster.k8s.io/v1alpha1/clusters";
static namespaced = true;
getStatus() {
if (this.metadata.deletionTimestamp) return ClusterStatus.REMOVING;
+1
View File
@@ -143,3 +143,4 @@ export const appSemVer = new SemVer(packageInfo.version);
export const docsUrl = "https://docs.k8slens.dev/main/" as string;
export const sentryDsn = packageInfo.config?.sentryDsn ?? "";
export const contentSecurityPolicy = packageInfo.config?.contentSecurityPolicy ?? "";
+5 -1
View File
@@ -7,7 +7,7 @@ import net from "net";
import type http from "http";
import spdy from "spdy";
import type httpProxy from "http-proxy";
import { apiPrefix, apiKubePrefix } from "../../common/vars";
import { apiPrefix, apiKubePrefix, contentSecurityPolicy } from "../../common/vars";
import type { Router } from "../router/router";
import type { ClusterContextHandler } from "../context-handler/context-handler";
import logger from "../logger";
@@ -239,6 +239,10 @@ export class LensProxy {
}
}
if (contentSecurityPolicy) {
res.setHeader("Content-Security-Policy", contentSecurityPolicy);
}
this.dependencies.router.route(cluster, req, res);
}
}