Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start API server only once #2382

Merged
merged 1 commit into from
Jul 1, 2019

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Jul 1, 2019

Signed-off-by: David Gageot david@gageot.net

@codecov
Copy link

codecov bot commented Jul 1, 2019

Codecov Report

Merging #2382 into master will increase coverage by 0.01%.
The diff coverage is 68.05%.

Impacted Files Coverage Δ
cmd/skaffold/app/cmd/dev.go 25% <ø> (+0.6%) ⬆️
cmd/skaffold/app/cmd/runner.go 68.42% <ø> (-0.81%) ⬇️
pkg/skaffold/event/event.go 89.79% <100%> (ø) ⬆️
pkg/skaffold/runner/runner.go 69.91% <100%> (+1.45%) ⬆️
cmd/skaffold/app/cmd/cmd.go 64.58% <55.88%> (-0.13%) ⬇️
pkg/skaffold/server/server.go 66.1% <71.42%> (-1.09%) ⬇️

@dgageot dgageot force-pushed the start-api-server-once branch from b9f5324 to 5920a42 Compare July 1, 2019 06:15
@dgageot
Copy link
Contributor Author

dgageot commented Jul 1, 2019

WDYT? @nkubala

@dgageot dgageot force-pushed the start-api-server-once branch from 5920a42 to 3b5ccdf Compare July 1, 2019 13:59
@dgageot dgageot added the kokoro:run runs the kokoro jobs on a PR label Jul 1, 2019
@dgageot dgageot force-pushed the start-api-server-once branch from 3b5ccdf to 68a486c Compare July 1, 2019 15:06
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Jul 1, 2019
Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this LGTM, but someone more familiar with the event API should probably take a look!

// Start API Server
if cmd.Use == "dev" {
// TODO(dgageot): api server is always started in dev mode, right now.
// It should instead default to true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean default to false, if the api server is always started right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it should default to true for dev mode but the user should be able to disable it. Currently, it's always on for dev mode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about either

  • changing the --enable-rpc flag to a *bool, so we can tell if the user didn't provide the flag (vs. explicitly providing --enable-rpc=false, or
  • adding a separate flag --disable-rpc, and checking that here e.g. if cmd.Use == "dev" && opts.DisableRPC == false. we'd have to have a way to make sure users don't set --enable-rpc and --disable-rpc at the same time though (don't know if there's an easy way to do this using cobra)

I'm fine with this being out of scope for this PR though.

Signed-off-by: David Gageot <david@gageot.net>
@dgageot dgageot force-pushed the start-api-server-once branch from 68a486c to c1cd11c Compare July 1, 2019 16:47
Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// Start API Server
if cmd.Use == "dev" {
// TODO(dgageot): api server is always started in dev mode, right now.
// It should instead default to true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about either

  • changing the --enable-rpc flag to a *bool, so we can tell if the user didn't provide the flag (vs. explicitly providing --enable-rpc=false, or
  • adding a separate flag --disable-rpc, and checking that here e.g. if cmd.Use == "dev" && opts.DisableRPC == false. we'd have to have a way to make sure users don't set --enable-rpc and --disable-rpc at the same time though (don't know if there's an easy way to do this using cobra)

I'm fine with this being out of scope for this PR though.

@dgageot dgageot merged commit 23da73c into GoogleContainerTools:master Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants