Skip to content

Commit

Permalink
fix(commands): don't use default port in serve cmd
Browse files Browse the repository at this point in the history
Before this commit, the `garden serve` command would use
`DEFAULT_PORT` as the default value for its `port` option.

If another command was already running and serving on
`DEFAULT_PORT` when `garden serve` was called, this would result in an
error.

This was fixed by deferring to the standard random port selection logic
we use for other commands by skipping the default value for this command
option.
  • Loading branch information
thsig authored and eysi09 committed Mar 5, 2020
1 parent a383459 commit 4babaef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions garden-service/src/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import { LoggerType } from "../logger/logger"
import { IntegerParameter, PrepareParams } from "./base"
import { Command, CommandResult, CommandParams } from "./base"
import { sleep } from "../util/util"
import { DEFAULT_PORT, GardenServer, startServer } from "../server/server"
import { GardenServer, startServer } from "../server/server"

const serveArgs = {}

const serveOpts = {
port: new IntegerParameter({
help: `The port number for the Garden service to listen on.`,
defaultValue: DEFAULT_PORT,
}),
}

Expand Down

0 comments on commit 4babaef

Please sign in to comment.