-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/digitalocean : Floating IPs #3748
Conversation
Wait, why do we need to |
…e call to the DO api takes a few seconds to propagate so I had to sacriface some kittens and added a short 10 second sleep
@carlosdp I am not sure what action I can call
The Create doesn't actually return a status (as per the API docs https://developers.digitalocean.com/documentation/v2/#create-a-new-floating-ip-assigned-to-a-droplet To use the Action ( the time.Sleep is only there as a last ditch attempt - I would love to be able to remove it |
Ahhhh, I see |
@carlosdp it's kinda weird - right? I have just been experimenting with this code instead:
But I still get an error (just in a different place now)
So.... I think there either needs to be a change to the DO API or I am stuck thoughts? |
@stack72 I think that might be because you created the Floating IP with a It's not in their docs, but I imagine you can "GET" the "actions" on a Floating IP instead after you create it? I would have to try it and see. |
@stack72 Yea, just confirmed that works, you can hit the (They should be documenting that, seems like a big oversight on their part, I'll let them know) |
@carlosdp The go-SDK doesn't really support that.
The Get request of the floating IPs actions requires an IP address and an actionId. Tried a 0 and still failed
I am going to open a request on their API to do this for me |
Are you going to open a PR? If not, I can do that for that library. |
I was going to create an issue - I am not quite familiar enough with the API to open a PR right now If you can help, that would be ace! |
Yea, I'll do that real quick, I really want this provider =P |
Opened digitalocean/godo#71, hopefully we can get a review on that soon. If you want to work against my branch though, just change the import directive to import "github.com/carlosdp/godo" until they merge it into master. That should allow you to test the changes and finalize this, pending DO. |
@carlosdp I am getting the following error:
|
Ah, right, my bad. The import would have to be changed everywhere in the code path in order for it to work =P Even though my Client is the "same", it's considered different by Go. |
So the code now looks as follows:
I am assuming that I shouldn't just use the |
Yea, |
The PR was merged on the godo lib, so you should be able to just |
Alternatively, I guess if you know the droplet's region, you can just create the Floating IP on the region instead and then "Assign" it to the droplet, thereby giving you back the action ID, skipping all the listing logic. Your call. |
9690845
to
a8bbbab
Compare
@carlosdp this has now been implemented and hopefully will be reviewed soon :)
The time.Sleep has now been removed |
…rking without a time.Sleep
a8bbbab
to
3fc9107
Compare
Looks good to me. Thanks @stack72! |
provider/digitalocean : New Resource for Floating IPs
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. |
This acceptance tests now work as follows: