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

Correctly delete openstack_networking_router_interface_v2 resources #1297

Conversation

pascal-hofmann
Copy link
Contributor

When creating multiple openstack_networking_router_interface_v2
resources for different IPv6 subnets in the same network, openstack will
attach these to the same port on the router.

On destroy the current implementation will pass the port_id to
routers.RemoveInterface, which will trigger the deletion of the whole
port, including other openstack_networking_router_interface_v2 resources
on the same port.

This commit changes this behaviour (so that only the correct router interface
gets deleted) and adds a test case that ensures this does not break
again in the future.

Note: We were affected by this bug. In our case we deleted an openstack_networking_router_interface_v2 via terraform destroy -target …, but terraform-provider-openstack silently deleted the whole port including another, important openstack_networking_router_interface_v2 resource which was crucial for our production setup.

When creating multiple openstack_networking_router_interface_v2
resources for different IPv6 subnets in the same network, openstack will
attach these to the same port on the router.

On destroy the current implementation will pass the port_id to
routers.RemoveInterface, which will trigger the deletion of the whole
port, including other openstack_networking_router_interface_v2 resources
on the same port.

This commit changes this behaviour (so that only the correct router interface
gets deleted) and adds a test case that ensures this does not break
again in the future.
@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 6, 2021

@pascal-hofmann
Copy link
Contributor Author

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 6, 2021

@pascal-hofmann
Copy link
Contributor Author

No idea why the status checks fail. I'm lost in the thousands of log lines. Can someone help with this?

@pascal-hofmann
Copy link
Contributor Author

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 12, 2021

@pascal-hofmann
Copy link
Contributor Author

recheck

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 22, 2021

Build succeeded.

Copy link
Member

@ozerovandrei ozerovandrei left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you @pascal-hofmann

@ozerovandrei ozerovandrei merged commit 0c65fdb into terraform-provider-openstack:main Oct 25, 2021
@pascal-hofmann pascal-hofmann deleted the fix/bad-routers-remove-interface-call branch October 25, 2021 07:02
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.

None yet

2 participants