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

Fixes bash issue with parsing with multiple VPC CIDR blocks #121

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

bwhaley
Copy link
Member

@bwhaley bwhaley commented Jan 14, 2025

Fixes an issue introduced in #116 where configurations with multiple VPC CIDR blocks attached to a VPC would result in only one range being added to the NAT table. Connections from clients in the additional VPCs would not be NAT'd.

This is due to a difference in read behavior with regard to newlines. AL2 was using bash ~4.3 r46, while AL2023 uses 5.2. Many changes to IFS and read were made in between releases, and one of those changed the behavior such that the list was not being parsed correctly.

This PR updates the parsing to use readarray which does work with the list of CIDR ranges returned from the metadata endpoint. Also updates the test to include a secondary CIDR range on the VPC.

@bwhaley bwhaley marked this pull request as ready for review January 15, 2025 17:05
@bwhaley bwhaley requested a review from a team as a code owner January 15, 2025 17:05
@bwhaley bwhaley merged commit e4318e8 into main Jan 15, 2025
10 checks passed
@bwhaley bwhaley deleted the fix-bash-bug branch January 15, 2025 18:23
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.

2 participants