-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pure Go terraform-provider-libvirt experiment #813
Conversation
Keen to help, will jump on IRC. :) |
@kskewes thx so much for helping us on this. One thing we need to be careful: don't introduce It is the design of the see for example https://github.com/hashicorp/terraform-provider-google/tree/master/google |
These can be moved into the `main` package later if we progress the idea
@dmacvicar I saw on the In my opinion we should conserve the E.g what I think is that we we could risk a bad naming or even structure in this refactoring, and later we can with difficulty modify |
Yes. As part of the port, we should not refactor. After the port, we can discuss the potential refactorings. I can't remember the context of subpackages, but AWS provider has them (internal package and many subpackages there). |
@kskewes I think I now understand the issue with
|
The only failing testacc here is:
Which I understand is because this operation is really not supported by libvirt, so we will fix it on master. |
The branch is now on master! Thanks a lot @kskewes @MalloZup !! |
This is so cool. Thanks for making things simpler! I took it for a spin at https://github.com/rgl/terraform-libvirt-ubuntu-example/tree/wip and I found this problem:
Should I open a new issue? |
I believe this one is related to #784 and #788 and more in detail #788 (review) So I need to fix this before the release. Thanks for giving it up a spin. I let you know when I publish a pre-release with the fix. |
@rgl it was more related to #813 (comment) Fixed. Can you check if 0.6.9-pre4 works for you? |
@dmacvicar, I would, but there's no -pre4 at https://registry.terraform.io/providers/dmacvicar/libvirt/latest only -pre3. |
@rgl sorry, I forgot I still have the automated released generating draft releases. Published now! |
At the first try it failed (because the network was created when the previous run fail) to start with:
After manually starting the network, all worked! Thank you! :-) |
This is an experiment to attempt to make the provider independent of the operating system. The motivation is to be able to distribute it via the terraform registry (#747). As an experiment, it is not guaranteed that the changes will make into the main branch.
The strategy is to move from libvirt-go to go-libvirt. The later implements the libvirt RPC protocol natively in Go.
The main challenges are:
The go-libvirt API is different. Closer to the C API.
The libvirt-go API attempts to be more object oriented. This means carrying the libvirt connection object into many helper functions, resulting in diffs like this:
(we will document more as we learn in this branch)
To make it easier:
Most of the changes are tedious and mechanic. This is a great opportunity to read a lot of the code and get an idea of what improvements and cleanups can be done later.
If you are interested in helping this experiment, get in touch with me so that we work in different areas/files.
Ideas for post-port refactorings and clenups
Brainstorming some ideas here