-
Notifications
You must be signed in to change notification settings - Fork 382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pkg/hyperkube/hyperkube.go
Outdated
@@ -164,6 +165,9 @@ func (hk *HyperKube) Run(args []string, stopCh <-chan struct{}) error { | |||
|
|||
s, err := hk.FindServer(serverName) | |||
if err != nil { | |||
if len(args) > 0 { | |||
goto RunAgain // let's keep trying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: May want to clarify that what we are really doing is chopping off the left-most os arg and trying with the remaining args to deal with varying entry points.
@@ -164,6 +165,9 @@ func (hk *HyperKube) Run(args []string, stopCh <-chan struct{}) error { | |||
|
|||
s, err := hk.FindServer(serverName) | |||
if err != nil { | |||
if len(args) > 0 { | |||
goto RunAgain // the first args was popped off at start of Run, try again with new args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How/Why does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you read the helpful comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have to pop off args at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was how this code worked. I, clearly, did not write that part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the existing code popped off the first item in the array because it represents the entrypoint (e.g. main.go or the name of the binary) and isn't really one of the arguments for the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I get it, we're looking for apiserver
or controller-manager
specifically here. Seems like there's something weird still.
thanks @carolynvs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you do a demo of this goland?
prob not, but maybe in a few weeks |
Until #1983 is fixed, I wanted a way to be able to run the api server in debug mode from goland. This was impossible with the current setup so I fixed it to work.