mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Correctly catch and notify user about NodeShell pod failures (#4244)
* Correctly catch and notify user about NodeShell pod failures Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix error throwing sometimes during Terminal.detach Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
1ce2e727af
commit
c37a8aee0a
7 files changed
+87
-84
No files matched your search
@@ -23,18 +23,11 @@ import { chunk } from "lodash";
|
||||
import net from "net";
|
||||
import url from "url";
|
||||
import { apiKubePrefix } from "../../common/vars";
|
||||
import { ClusterManager } from "../cluster-manager";
|
||||
import type { ProxyApiRequestArgs } from "./types";
|
||||
|
||||
const skipRawHeaders = new Set(["Host", "Authorization"]);
|
||||
|
||||
export async function kubeApiRequest({ req, socket, head }: ProxyApiRequestArgs) {
|
||||
const cluster = ClusterManager.getInstance().getClusterForRequest(req);
|
||||
|
||||
if (!cluster) {
|
||||
return;
|
||||
}
|
||||
|
||||
export async function kubeApiRequest({ req, socket, head, cluster }: ProxyApiRequestArgs) {
|
||||
const proxyUrl = await cluster.contextHandler.resolveAuthProxyUrl() + req.url.replace(apiKubePrefix, "");
|
||||
const apiUrl = url.parse(cluster.apiUrl);
|
||||
const pUrl = url.parse(proxyUrl);
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
|
||||
import type http from "http";
|
||||
import type net from "net";
|
||||
import type { Cluster } from "../cluster";
|
||||
|
||||
export interface ProxyApiRequestArgs {
|
||||
req: http.IncomingMessage,
|
||||
socket: net.Socket,
|
||||
head: Buffer,
|
||||
cluster: Cluster,
|
||||
}
|
||||
Reference in new issue
Block a user