Skip to content

Commit

Permalink
fix port-fwd for k8s with default http_rpc (#1960)
Browse files Browse the repository at this point in the history
* fix port-fwd for k8s with default http_rpc

* eslint
  • Loading branch information
pepoviola authored Feb 17, 2025
1 parent 2cb4431 commit 078cdc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions javascript/packages/orchestrator/src/networkNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { makeRe } from "minimatch";
import {
DEFAULT_INDIVIDUAL_TEST_TIMEOUT,
LOCALHOST,
RPC_HTTP_PORT,
RPC_WS_PORT,
WS_URI_PATTERN,
} from "./constants";
Expand Down Expand Up @@ -78,10 +79,14 @@ export class NetworkNode implements NetworkNodeInterface {

const url = new URL(this.wsUri);
if (
parseInt(url.port, 10) !== RPC_WS_PORT &&
![RPC_WS_PORT, RPC_HTTP_PORT].includes(parseInt(url.port, 10)) &&
client.providerName !== "native"
) {
const fwdPort = await client.startPortForwarding(RPC_WS_PORT, this.name);
// use rpc_port as default (since ws_port was deprecated in https://github.com/paritytech/substrate/pull/13384)
const fwdPort = await client.startPortForwarding(
RPC_HTTP_PORT,
this.name,
);

this.wsUri = WS_URI_PATTERN.replace("{{IP}}", LOCALHOST).replace(
"{{PORT}}",
Expand Down

0 comments on commit 078cdc5

Please sign in to comment.