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:
Sebastian Malton authored and GitHub committed 2021-11-09 22:52:46 -05:00
1 parent 1ce2e727af
commit c37a8aee0a
7 files changed
+87 -84

No files matched your search

+1 -8
View File
@@ -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);
+2
View File
@@ -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,
}