Skip to content

Commit

Permalink
revert: fix(core): error when forwarding to a restricted local port
Browse files Browse the repository at this point in the history
This reverts commit e6a103b.
  • Loading branch information
mjgallag authored and edvald committed Dec 19, 2019
1 parent ca0992b commit 4fa85dc
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 38 deletions.
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/port-forward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { ChildProcess } from "child_process"

import getPort = require("get-port")
const AsyncLock = require("async-lock")
import { V1Service } from "@kubernetes/client-node"

Expand All @@ -22,7 +23,6 @@ import { ForwardablePort } from "../../types/service"
import { isBuiltIn } from "./util"
import { LogEntry } from "../../logger/log-entry"
import { RuntimeError } from "../../exceptions"
import { getPort } from "../../util/network"

// TODO: implement stopPortForward handler

Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { isEqual, invert } from "lodash"
import Bluebird from "bluebird"
import { createServer, Server, Socket } from "net"
const AsyncLock = require("async-lock")
import getPort = require("get-port")
import { Service, ServiceStatus, ForwardablePort } from "./types/service"
import { Garden } from "./garden"
import { registerCleanupFunction } from "./util/util"
import { LogEntry } from "./logger/log-entry"
import { GetPortForwardResult } from "./types/plugin/service/getPortForward"
import { getPort } from "./util/network"

interface PortProxy {
key: string
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import serve = require("koa-static")
import Router = require("koa-router")
import websockify from "koa-websocket"
import bodyParser = require("koa-bodyparser")
import getPort = require("get-port")
import { omit } from "lodash"

import { Garden } from "../garden"
Expand All @@ -27,7 +28,6 @@ import { EventName, Events } from "../events"
import { ValueOf } from "../util/util"
import { AnalyticsHandler } from "../analytics/analytics"
import { joi } from "../config/common"
import { getPort } from "../util/network"

export const DEFAULT_PORT = 9777
const notReadyMessage = "Waiting for Garden instance to initialize"
Expand Down
24 changes: 0 additions & 24 deletions garden-service/src/util/network.ts

This file was deleted.

2 changes: 1 addition & 1 deletion garden-service/test/unit/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { expect } from "chai"
import { deepOmitUndefined } from "../../../../src/util/util"
import uuid from "uuid"
import request = require("supertest")
import getPort = require("get-port")
import WebSocket = require("ws")
import { getPort } from "../../../../src/util/network"

describe("startServer", () => {
let garden: Garden
Expand Down
10 changes: 0 additions & 10 deletions garden-service/test/unit/src/util/network.ts

This file was deleted.

0 comments on commit 4fa85dc

Please sign in to comment.