mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into show-extension-preferences-in-separate-page
This commit is contained in:
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;
|
||||
|
||||
@@ -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 ?? "";
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user