As a few users have pointed out, Gophercloud moved to its own organization and repo, gophercloud/gophercloud. It's in the best interest of the OpenStack provider to move to this repository -- and it will as soon as possible. This Issue will serve as confirmation that the move will happen, provide updates on a status, and answer any questions users might have.
First and foremost, it's unfortunately not possible to simply s/rackspace/gophercloud/g and call it a day. Gophercloud went through a large cleanup during the move and incompatibilities exist. I'm in the process of cleaning up the Gophercloud acceptance tests as a way to find any potential bugs. I'm adding these items to the MIGRATING doc, so keep an eye on it if you're interested.
Quick update on this: I only have the Neutron/Networking component of Gophercloud left to review. Once that's done, it's on to Terraform. Rough steps will include:
gophercloud/gophercloud.Conservatively, I'd estimate a month.
@jtopjian I'd be game for assisting with migration tasks if that would help...
Is it worth creating a long-lived branch somewhere to try out the changes?
@fatmcgav Thanks for the offer. How about:
gophercloud-migration at https://github.com/jtopjian/terraform be the central area to work on / merge changes.The reason I'm hesitant to start, or recommend starting, migrating now is just to finish some housekeeping and getting ducks in a row. If anyone is really keen to start migrating right now, go for it, but there's probably going to be some rebasing required on any work done right now. :)
@jtopjian Sounds like a sensible plan to me... :)
It has begun!
https://github.com/jtopjian/terraform/tree/gophercloud-migration
Status: go test passes, but acceptance tests are failing.
I wanted to provide a quick update:
Most acceptance tests are passing.
Unfortunately I've been tied up with some other work and haven't been able to spend a lot of time on this in the past few days. I hope to get back to work on this shortly.
Quasi-weekly status update:
The above work has involved submitting PRs to gophercloud, so all of my work has been over there lately.
Once the above is done, I need to look at error handling.
Unfortunately, I expect a few more weeks on this.
@jtopjian Is this at a point where I can hack away and try #7041?
As the lack of scoping is starting to cause us pain, and as we've already got to compile TF from source for an unrelated issue, no harm in adding in :)
@fatmcgav Absolutely, go for it. :)
Cool, i'll report back any issues :)
@jtopjian Not sure if it's something I'm doing, but some of the unit tests fail on this branch :(
Making these tweaks seems to have enabled the tests to pass:
diff --git a/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go b/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go
index 42e6ec8..11185f1 100644
--- a/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go
+++ b/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go
@@ -1120,7 +1120,7 @@ func testAccCheckComputeV2InstanceMetadata(
continue
}
- if v == value.(string) {
+ if v == value {
return nil
}
diff --git a/builtin/providers/openstack/resource_openstack_lb_vip_v1.go b/builtin/providers/openstack/resource_openstack_lb_vip_v1.go
index 9f64f75..3f7e3da 100644
--- a/builtin/providers/openstack/resource_openstack_lb_vip_v1.go
+++ b/builtin/providers/openstack/resource_openstack_lb_vip_v1.go
@@ -248,8 +248,9 @@ func resourceLBVipV1Update(d *schema.ResourceData, meta interface{}) error {
// If a floating IP is found we unassign it
if len(fips) == 1 {
+ emptyPort := ""
updateOpts := floatingips.UpdateOpts{
- PortID: "",
+ PortID: &emptyPort,
}
if err = floatingips.Update(networkingClient, fips[0].ID, updateOpts).Err; err != nil {
return err
@@ -339,7 +340,7 @@ func lbVipV1AssignFloatingIP(floatingIP, portID string, networkingClient *gopher
}
updateOpts := floatingips.UpdateOpts{
- PortID: portID,
+ PortID: &portID,
}
if err = floatingips.Update(networkingClient, fips[0].ID, updateOpts).Err; err != nil {
return err
diff --git a/builtin/providers/openstack/resource_openstack_networking_floatingip_v2.go b/builtin/providers/openstack/resource_openstack_networking_floatingip_v2.go
index 02c3f79..14db57e 100644
--- a/builtin/providers/openstack/resource_openstack_networking_floatingip_v2.go
+++ b/builtin/providers/openstack/resource_openstack_networking_floatingip_v2.go
@@ -139,7 +139,8 @@ func resourceNetworkFloatingIPV2Update(d *schema.ResourceData, meta interface{})
var updateOpts floatingips.UpdateOpts
if d.HasChange("port_id") {
- updateOpts.PortID = d.Get("port_id").(string)
+ newPortId := d.Get("port_id").(string)
+ updateOpts.PortID = &newPortId
}
log.Printf("[DEBUG] Update Options: %#v", updateOpts)
To be expected?
@fatmcgav Indeed expected - there are two things causing the issues you're seeing:
Both of which required changes to Gophercloud, but I haven't had a chance to modify Terraform appropriately.
Ah, fair enough :) Well the test's pass for the moment... ;)
@fatmcgav I've pushed a new commit that takes care of the errors you're seeing.
@jtopjian Yeh, just spotted that... Cheers :)
I bring good news: All acceptance tests are passing!
A big Thank You to @fatmcgav for his help over the past few weeks! :smile:
This brings a lot of confidence that the new Gophercloud repo is stable. There have been no changes to any resource attributes. If all goes well, this _should_ be a drop-in replacement for the current OpenStack provider. However, there might still be some bugs hidden in cases that are not tested. I encourage anyone who has the time to test out the gophercloud-migration repo and report any issues.
Next steps: I just have to clean up the gophercloud-migration branch a bit and this should be good to go -- hopefully within the next week or two.
I apologize for the delay. There was more work than I anticipated, plus I had some scheduling issues.
No need to apologize @jtopjian. You've done great babysitting this and related issues for a LONG time and also done most of the work. Thank you.
This has been merged! Please let me know if you run into any issues.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
It has begun!
https://github.com/jtopjian/terraform/tree/gophercloud-migration
Status:
go testpasses, but acceptance tests are failing.