redid changes after large refactor on master (#4688)

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann authored and GitHub committed 2022-01-20 09:38:16 -05:00
1 parent 23c38b1f4e
commit 6cba82c491
4 files changed
+5 -15

No files matched your search

+1 -2
View File
@@ -14,11 +14,10 @@ export class PortForwardRoute {
const { namespace, resourceType, resourceName } = params;
const port = Number(query.get("port"));
const forwardPort = Number(query.get("forwardPort"));
const protocol = query.get("protocol");
const portForward = PortForward.getPortforward({
clusterId: cluster.id, kind: resourceType, name: resourceName,
namespace, port, forwardPort, protocol,
namespace, port, forwardPort,
});
respondJson(response, { port: portForward?.forwardPort ?? null });
+1 -5
View File
@@ -16,7 +16,6 @@ export interface PortForwardArgs {
name: string;
port: number;
forwardPort: number;
protocol?: string;
}
interface Dependencies {
@@ -32,8 +31,7 @@ export class PortForward {
pf.kind == forward.kind &&
pf.name == forward.name &&
pf.namespace == forward.namespace &&
pf.port == forward.port &&
(!forward.protocol || pf.protocol == forward.protocol)
pf.port == forward.port
));
}
@@ -44,7 +42,6 @@ export class PortForward {
public name: string;
public port: number;
public forwardPort: number;
public protocol: string;
constructor(private dependencies: Dependencies, public pathToKubeConfig: string, args: PortForwardArgs) {
this.clusterId = args.clusterId;
@@ -53,7 +50,6 @@ export class PortForward {
this.name = args.name;
this.port = args.port;
this.forwardPort = args.forwardPort;
this.protocol = args.protocol ?? "http";
}
public async start() {
@@ -18,7 +18,6 @@ export const routePortForward =
const { namespace, resourceType, resourceName } = params;
const port = Number(query.get("port"));
const forwardPort = Number(query.get("forwardPort"));
const protocol = query.get("protocol");
try {
let portForward = PortForward.getPortforward({
@@ -28,7 +27,6 @@ export const routePortForward =
namespace,
port,
forwardPort,
protocol,
});
if (!portForward) {
@@ -46,7 +44,6 @@ export const routePortForward =
name: resourceName,
port,
forwardPort: thePort,
protocol,
});
const started = await portForward.start();