-
Notifications
You must be signed in to change notification settings - Fork 977
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
Module net-vpc fix for reserved ranges #2538
Module net-vpc fix for reserved ranges #2538
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
The changes assume you would use a different prefix for the ranges of each service. :) This should work, would you mind signing the CLA and adding an example to the README, so we have a test for this use case? |
468b26c
to
5591ca8
Compare
I had the wrong email in my commit so it didn't show i had already signed the CLA. I will update the readme. For our use case, we don't want to add the prefix as we have existing psa ranges configured without a prefix. We actually separated out the external service producers from our net-vpc module as it didn't support that use case at the time. We want to be able to control what ranges are reserved for a service producer. I think this change will achieve that. However, if there is another way to achieve that, its also fine! This was just the solution I found when trying to fix it for our use case. |
I updated the readme with an example. I hope it is ok. The one thing I am not sure about is creating the testing for such an example. |
The contributing guide in the repo root explains how to handle tests. The simplest thing you can do is add a tftest comment line in the example, with the number of modules and resources in the plan. |
With the recent changes regarding the prefix for the PSA ranges, it created an issue for allocating the correct reserved ranges for a service producer. In the current version, each service producer will be allocated all ranges in the reserved ranges. This appears to only happen when there are multiple service producers defined.
This fix in this PR ensures that, within the
psa_configs
object, only the ranges specified in the service producer are reserved not all.Example
In the following
psa_configs
, we expect to see thatservicenetworking.googleapis.com
has reserved ranges forgoogle-services-0
andpsa
. However, in the plan we see it also hasnetapp-services-0
,example-producer
, andexample-producer2
The fix would avoid the three extra ranges
Here we can see that for the
servicenetworking.googleapis.com
service producer it adds all ranges to thereserved_peering_ranges
Plan from the fix for service producer
example.servicenetworking.goog
Checklist
I applicable, I acknowledge that I have:
terraform fmt
on all modified filestools/tfdoc.py