-
Notifications
You must be signed in to change notification settings - Fork 2k
Machine-specific persistent option to specify SSH config #3410
base: master
Are you sure you want to change the base?
Conversation
5727275
to
d322b8d
Compare
Please sign your commits following these rules: $ git clone -b "use-user-ssh-config" git@github.com:brettdh/machine.git somewhere
$ cd somewhere
$ git rebase -i HEAD~7
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
d322b8d
to
5a52439
Compare
Gordon is a little excitable about a missing sign-off, it seems. |
@nathanleclaire any further thoughts on this and/or #3209? |
Is |
@bamarni yep, that's correct. Just a shortcut (barely). |
Any progress on this? This will block anyone with a slightly complicated SSH setup. |
@brettdh I'd happily take this over if you aren't inclined. |
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This adds two flags to the `generic` driver: --generic-ssh-config-file <path/to/config> Use the provided config file with the external SSH client (-F) --generic-use-user-ssh-config Use ~/.ssh/config as the config file The flags are mutually exclusive in order to avoid ambiguity. This also adds the SSHConfigFile parameter to BaseDriver and a GetSSHConfigFile method to all drivers. It seems like there should be a way to reduce this duplication, since most of the implementations are identical (return "/dev/null"). I'm a golang noob, though, so if you know of a better way to accomplish this, please let me know. Tried this out in my environment, which requires a `ProxyCommand` to access a remote site via SSH. Before, the issue described in docker-archive-public#3310 occurred, preventing me from using `docker-machine` to configure this host. With this, the `--generic-use-user-ssh-config` option adds the config file in place of the previous-default `/dev/null` and all seems well. Also added a couple unit test cases. Fixes docker-archive-public#3318. Signed-off-by: Brett Higgins <brhiggins@arbor.net>
The listening server speaks HTTP, so doing the validation check should take HTTP proxy settings from env vars into account. Signed-off-by: Brett Higgins <brhiggins@arbor.net>
See docker-archive-public#3209 Signed-off-by: Brett Higgins <brhiggins@arbor.net>
Signed-off-by: Brett Higgins <brhiggins@arbor.net>
To hopefully avoid breaking that test. Signed-off-by: Brett Higgins <brhiggins@arbor.net>
Signed-off-by: Brett Higgins <brhiggins@arbor.net>
5a52439
to
38ce22f
Compare
@lox rebased and resolved conflicts. I'd say this is still in @nathanleclaire 's court, though - I don't know what he wanted to do about #3209, so that conversation was blocking this, IIRC. |
Yup fair enough. Merging this would at least let the majority of users who need ssh proxying get on with things though, as it stands machine just doesn't work for us. |
Good news is that docker-machine is tremendously easy to build, so if you
|
I'm fairly allergic to distributing custom builds of docker things internally, but yup, fair point. |
Here's some thinking on this. Sorry it's been slow going but it's a bit riskier change than most.
thanks for your persistence and interest in this. |
Agree with dropping |
I'm taking a crack at this, but my golang is rusty, and I feel like I'm doing something rather dumb - or just not fully understanding the details of
I think you answered your own question in the next bit; we need to be able to retrieve the saved options because the user isn't providing this option on every invocation. ...at least, that would have been my answer a few minutes ago. Looking more carefully, it looks like
Maybe? It's been a while since I tested it, but I thought that the missing value would end up with a value of Giving this a quick test: with a machine created with 0.8.1, and using this PR's build to talk to it,
This has now been brought up by three different people, so I give. 😅 |
- Remove --use-user-ssh-config - Remove GetMachineOptions - Remove modification to vendored code - Instead set proxy in mcndockerclient/docker_client.go Signed-off-by: Brett Higgins <brhiggins@arbor.net>
2dfbeca
to
e1a85b6
Compare
client, err := dockerclient.NewDockerClient(url, tlsConfig) | ||
if err != nil { | ||
transport := (client.HTTPClient.Transport).(*http.Transport) | ||
transport.Proxy = http.ProxyFromEnvironment |
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.
This is the part I'm uncertain about - whether it is sane to update the proxy setting in this way.
...I hope, anyway - by not trying to SetMachineOptions on the remote driver if this is the ci-test driver. Have to push to test, as this doesn't seem to fail on my laptop. Signed-off-by: Brett Higgins <brhiggins@arbor.net>
@nathanleclaire any further thoughts on this? I think I've addressed all your concerns stated above, except perhaps the API version non-bump testing that you mentioned, as I'm not sure how to go about that. |
@nathanleclaire had another coworker get bit by the lack of this feature today. Any chance we could take another look at this soon? |
Any status on this? I can't use docker-machine because of it. |
I am not maintainer any more -- ping @shin- |
And I'm not using docker-machine these days, so @lox if you still want to take it over, be my guest :) |
@shin- Any thoughts on this? Thanks! |
@shin this makes impossible to use GitLab CI autoscale approach within isolated network |
What is the status of this? This is currently a big impediment for connecting to remotes beyond bastions. |
Could please any maintainer summarize the changes needed to get this to master? Thanks 👍 |
Is there an update on this? |
@nathanleclaire
This adds two flags to
docker-machine create
:(The flags are mutually exclusive in order to avoid ambiguity.)
Tried this out in my environment, which requires a
ProxyCommand
toaccess a remote site via SSH. Before, the issue described in #3310
occurred, preventing me from using
docker-machine
to configure thishost. With this, the
--generic-use-user-ssh-config
option addsthe config file in place of the previous-default
/dev/null
and allseems well.
Also added a couple unit test cases.
Depends on an updated version of #3209.
Note that this PR includes brettdh/machine@d39de4f
(which is just #3209 rebased on master).
The merge will be a bit messy, since this will get rebased on whatever #3209
becomes, but at least now it can be reviewed in relative isolation.
I considered setting the base for this PR on brettdh/machine@d39de4f,
but I'm pretty sure that would make a PR on my fork, rather than on docker/machine.