Skip to content
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: Fixing panic condition on FloatingIP droplet #4214

Merged
merged 1 commit into from Dec 8, 2015

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Dec 8, 2015

Fixes #4162
Fixing the digitalocean floatingip resource for a panic when droplet wasn't available

@jen20
Copy link
Contributor

jen20 commented Dec 8, 2015

LGTM. Thanks @stack72!

jen20 added a commit that referenced this pull request Dec 8, 2015
provider/digitalocean: Fixing panic condition on FloatingIP droplet
@jen20 jen20 merged commit 53609c8 into hashicorp:master Dec 8, 2015
if floatingIp.Droplet != nil {
log.Printf("[INFO] The region of the Droplet is %s", floatingIp.Droplet.Region)
d.Set("region", floatingIp.Droplet.Region.Slug)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, this skips setting the region at all if the floating IP exits but the droplet doesn't. It seems like we could fall back to the below else case, but not sure what the ramifications are.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good point, we should probably check this explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franklinhu the current tests for this are for both region based floatingips and floatingips with droplets. A floatingIP must either be created for a region OR a droplet. So if we fall back to the region then that seems to be the correct course of action

I haven't been able to trigger the panic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franklinhu ok, I just sent #4216. To be more explicit. I don't rely on the d.GetOk anymore. I use the API result directly and then check for a droplet and use the region that way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah awesome thanks!

@stack72 stack72 deleted the f-do-floatingip_panic branch December 8, 2015 16:55
@ghost
Copy link

ghost commented Apr 29, 2020

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.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic if Digital Ocean floating IP not assigned to droplet
3 participants