Fix interactive shell when using native-client #1571
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the way the
ssh
command is invoking the shell, and will therefore allow interactive use with the Go native client.Steps to reproduce:
Expected:
Due to #1531 I am unable to verify the build myself...
We invoke the shell as follows https://github.com/kubernetes/minikube/blob/master/pkg/minikube/cluster/cluster.go#L537
What happens is that we provide an empty string instead of no value: https://play.golang.org/p/z7DDUWnuYm You can verify this with:
At https://github.com/docker/machine/blob/master/libmachine/ssh/client.go#L269 the use of
args ...string
will result in args having a length of 1.this means that the check at https://github.com/docker/machine/blob/master/libmachine/ssh/client.go#L318 wrongly assumes that arguments are given, and it will execute https://github.com/docker/machine/blob/master/libmachine/ssh/client.go#L324
Docker machine itself uses a different way to invoke the shell https://github.com/docker/machine/blob/e1a03348ad83d8e8adb19d696bc7bcfb18ccd770/commands/ssh.go#L50
Therefore fixing this with: