digitalocean / go-libvirt

Package libvirt provides a pure Go interface for interacting with Libvirt. Apache 2.0 Licensed.
Apache License 2.0
927 stars 127 forks source link

Add TLS and SSH Dialers, and support libvirt URI parsing #209

Closed zaneb closed 7 months ago

zaneb commented 7 months ago

Add a Dialer for TLS connections. This removes the need for consumers of the library to write a lot of TLS setup code, and abstracts the weird part of the connection protocol discussed in #89.

Add a Dialer for SSH connections, using the golang stdlib ssh library.

Introduce a function to connect to an arbitrary libvirt connection URI. This removes the need for every consumer to reimplement this functionality if they want user-configurable connection parameters, and greatly simplifies the process of opening a connection. The transports that are implemented are unix, tcp, tls, libssh2, libssh, and ssh.

Note that for now all 3 of the ssh transports are implemented using the same golang ssh library for connection, so the behaviour may not always be identical to the libvirt client (in particular the ssh transport would normally be expected to pick up settings from the user's .ssh/config file by virtue of it shelling out to the ssh client).

Fixes #139 Fixes #143 Fixes #189

trapgate commented 7 months ago

Hang in there. The CI setup for go-libvirt has gotten a little long-in-the-tooth and needed updating. I've got a separate PR open to fix that; once it has merged you can update this PR and the tests should succeed.

trapgate commented 7 months ago

The CI updates are merged; if you pull the latest changes into your fork the tests should pass.

zaneb commented 7 months ago

Thanks! Rebased the branch on that CI change.