Using upstream connection providers and the future of the ssh transport #1164
Replies: 6 comments 5 replies
-
While option (a) would be the simplest long-term solution, option (b) seems like the most actionable path forward.
I can't speak for @scabala and @memetb & all other ssh transport contributors, but refactoring the current dialer to make use of the standard OpenSSH binary could offer users a more predictable experience. |
Beta Was this translation helpful? Give feedback.
-
Strangely enough, I read the libvirt documentation here
and was looking at the ef7bc723d6257183e8f901115b5880621b4455df message
and my personal preference is actually to do what libvirt does, which is to spawn out (b). I have no objection to the code already written being factored out, so long as we can achieve the desired end result (which for me is "as close to feature parity with libvirt as possible"), however I do want to say that there is no free lunch: ssh is complicated and there will not be a free solution no matter what. It just needs to be done once and correctly. By this metric, I dislike that the upstream feature implementation does not make use of the ssh_config library and instead re-rolls out that functionality. And while the purist in me also would love to see a golang implemented full solution upstream, the current upstream version is documented to have some of the exact shortcomings that were set out to be fixed in this project. Whether we like it or not, these issues will come here as bug reports (and we may feel relief because we can bump them upstream), we will not solve the end users' problems by doing so. One final thought is that while the code did generate create a couple of bugs, and revealed a couple of latent ones, it overall looks like it is now working as it should. I am reluctant to make changes without a solid landing site in plain view. So as it is right now: a) while it is more purist in spirit, the upstream code looks just as complicated to my eyes, is documented to have missing features, and may yet reveal issues we aren't aware of |
Beta Was this translation helpful? Give feedback.
-
When this provider was born, it was using the C interface, and that made the provider dependent on the underlying operating system, plus prevented us from being published on the registry. I ported it to use the pure-Go version to overcome these limitations. The upstream library has the same motivation and it is very likely used for automating infrastructure (Digital Ocean), even outside the context of terraform and a developer's laptop. You don't want to depend on a system ssh for that. I think we could do it in this order, to minimize disruption and risk:
|
Beta Was this translation helpful? Give feedback.
-
After some research and thinking, I do like idea of using upstream dialers - this is the way. However, as has been pointed out, using upstream
What do you think? |
Beta Was this translation helpful? Give feedback.
-
Got something working here. Should have something for testing soon. |
Beta Was this translation helpful? Give feedback.
-
If anyone wants to give it an early try. Only tested against my own localhost without any custom params). |
Beta Was this translation helpful? Give feedback.
-
After seeing that @zaneb landed digitalocean/go-libvirt#209 which provides the ConnectionURI upstream, with all the basic implementations, and seeing #1155 from @jgooge, I am undecided how to move forward, especially around the ssh transport (with contributions from @scabala and @memetb, among others).
I'd like to keep the provider as simple as possible, which means I am all for moving to the upstream
ConnectionURI
and just do:The main problem I see with ssh, where the upstream one does not support all the user config options (and not sure all the bastion features).
On the other hand, I am not happy with the complexity of the current ssh transport and the issues it generates.
I see the following options:
a. Upstreaming our ssh transport features (which somebody would need to do)
b. Use the upstream ones, except for ssh (parse the transport early and follow a different code-path)
For both cases, the complexity problem does not go away. One option could be to create a "spawn ssh binary" version of the dialer which uses the ssh binary, and allow to use that in the case of the standard
ssh
(vslibssh
) transport, or allow to enable it with some flag. This could be upstreamed or replace the one we use to override.Beta Was this translation helpful? Give feedback.
All reactions