Skip to content

fix: allocate a floating IP when reuse_ips finds none free - #168

Open
blacksoxx wants to merge 1 commit into
hashicorp:mainfrom
blacksoxx:reuse-ips-allocate-fallback
Open

blacksoxx wants to merge 1 commit into
hashicorp:mainfrom
blacksoxx:reuse-ips-allocate-fallback

Conversation

@blacksoxx

Copy link
Copy Markdown

Description

With reuse_ips = true the builder only searched for an unassociated floating IP and failed with no free floating IPs found when there was none, even though floating_ip_network was set. The docs describe reuse_ips as an attempt before allocating a new one, so the step now falls back to creating a floating IP on floating_ip_network when the search comes back empty. The allocated IP is marked temporary and released on cleanup like any other allocated one. Without floating_ip_network the error now says that no IP was free and no network was given. A Neutron error during the search still halts the build, and nothing changes when reuse_ips is false or when a free IP exists.

Tests for the step run against gophercloud's test server and cover the fallback and its cleanup, reuse of a free IP, the missing network error, a list error, and the plain floating_ip_network path.

Resolved Issues

Closes #167

Rollback Plan

If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

None.

With reuse_ips set the step only searched for an unassociated floating
IP and halted when there was none, even when floating_ip_network was
given. The docs describe reuse as an attempt before allocating a new
one, so fall back to creating one on floating_ip_network when the
search comes back empty, and say in the error when no network is
configured either. Neutron errors still halt without a fallback.

Fixes hashicorp#167

Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
@blacksoxx
blacksoxx requested a review from a team as a code owner November 10, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation of reuse_ips and behaviour mismatch

1 participant