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

common: fix subnet_filters when public IP set #370

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

lbajolet-hashicorp
Copy link
Contributor

In version 1.2.3 of the AWS plugin, we changed the way we set the subnet when the associate_public_ip_address argument is not unset.

This had the side-effect of breaking configuration which specified a subnet_id or a subnet_filter, as it would always default on inferring the most available one from the default (or selected) VPC.

This was a bug, and is fixed with this commit.

Closes #367
Related to #368

In version 1.2.3 of the AWS plugin, we changed the way we set the subnet
when the associate_public_ip_address argument is not unset.

This had the side-effect of breaking configuration which specified a
subnet_id or a subnet_filter, as it would always default on inferring
the most available one from the default (or selected) VPC.

This was a bug, and is fixed with this commit.
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner April 20, 2023 21:02
Copy link
Contributor

@JenGoldstrich JenGoldstrich left a comment

Choose a reason for hiding this comment

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

This largely LGTM but I would consider adding unit test for step_network_info, I'm not super familiar with how complex that would be on the Amazon plugin so feel free to disregard this if its complex, but since this caused a regression it might be worth adding a unit test to this in the future.

@lbajolet-hashicorp
Copy link
Contributor Author

Right now since we don't have any kind of architecture for unit-testing this step, we won't do it, especially since this broke the plugin for a fair amount of users, so we opted to rely on acceptance testing for this time.
We will definitely be revisiting this code and the tests that go with it.

@lbajolet-hashicorp lbajolet-hashicorp merged commit 0237a37 into main Apr 20, 2023
@lbajolet-hashicorp lbajolet-hashicorp deleted the fix_subnet_select_with_public_ip branch April 20, 2023 21:26
@nywilken
Copy link
Contributor

@JenGoldstrich @lbajolet-hashicorp I opened #371 to track the unit tests for this code base.

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.

subnet_filter broken in 1.2.3
3 participants