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

adds support for dynamic port allocation by adding missing params #6127

Closed
wants to merge 20 commits into from
Closed

adds support for dynamic port allocation by adding missing params #6127

wants to merge 20 commits into from

Conversation

prateek2408
Copy link
Contributor

@prateek2408 prateek2408 commented Jun 14, 2022

Adding missing parameter for google_compute_router_nat TF resource

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: added field `maxPortsPerVm` to resource `google_compute_router_nat`

This is fix for Issue- https://github.com/GoogleCloudPlatform/terraform-validator/issues/11765

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @ScottSuarez, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@prateek2408 prateek2408 changed the title adding params for dynamic port allocation- test adds support for dynamic port allocation Jun 14, 2022
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 14 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 1 file changed, 14 insertions(+), 1 deletion(-))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests 0
Skipped tests: 0
Failed tests: 0

Errors occurred during REPLAYING mode. Please fix them to complete your PR
View the build log

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@prateek2408 prateek2408 marked this pull request as ready for review June 16, 2022 05:35
@prateek2408 prateek2408 changed the title adds support for dynamic port allocation adds support for dynamic port allocation by adding missing params Jun 16, 2022
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 45 insertions(+))
Terraform Beta: Diff ( 2 files changed, 45 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2053
Passed tests 1824
Skipped tests: 226
Failed tests: 3

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccFirebaserulesRelease_BasicRelease|TestAccContainerCluster_withConfidentialNodes|TestAccContainerCluster_withAddons

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode:
TestAccContainerCluster_withAddons[view]
TestAccContainerCluster_withConfidentialNodes[view]

Please fix these to complete your PR
View the build log or the debug log for each test

@prateek2408
Copy link
Contributor Author

Fixed the release note issue

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 2 files changed, 45 insertions(+))
Terraform Beta: Diff ( 2 files changed, 45 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2053
Passed tests 1825
Skipped tests: 226
Failed tests: 2

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccContainerCluster_withConfidentialNodes|TestAccContainerCluster_withAddons

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode:
TestAccContainerCluster_withAddons[view]
TestAccContainerCluster_withConfidentialNodes[view]

Please fix these to complete your PR
View the build log or the debug log for each test

@ScottSuarez
Copy link
Contributor

Could you add a sample for this field?

@prateek2408
Copy link
Contributor Author

@ScottSuarez - Where should the sample be added. Should I add those parameters in this test function(testAccComputeRouterNatWithAllocationMethod) under path "//mmv1/third_party/terraform/tests/resource_compute_router_nat_test.go.erb"-

618 func testAccComputeRouterNatWithAllocationMethod(routerName string, enableEndpointIndependentMapping, enableDynamicPortAllocation bool) string {
619         return fmt.Sprintf(`
620 resource "google_compute_network" "foobar" {
621   name                    = "%s-net"
622   auto_create_subnetworks = "false"
623 }
624 
625 resource "google_compute_subnetwork" "foobar" {
626   name          = "%s-subnet"
627   network       = google_compute_network.foobar.self_link
628   ip_cidr_range = "10.0.0.0/16"
629   region        = "us-central1"
630 }
631 
632 resource "google_compute_address" "foobar" {
633   name   = "router-nat-%s-addr"
634   region = google_compute_subnetwork.foobar.region
635 }
636 
637 resource "google_compute_router" "foobar" {
638   name    = "%s"
639   region  = google_compute_subnetwork.foobar.region
640   network = google_compute_network.foobar.self_link
641   bgp {
642     asn = 64514
643   }
644 }
645 
646 resource "google_compute_router_nat" "foobar" {
647   name                               = "%s"
648   router                             = google_compute_router.foobar.name
649   region                             = google_compute_router.foobar.region
650   nat_ip_allocate_option             = "MANUAL_ONLY"
651   nat_ips                            = [google_compute_address.foobar.self_link]
652   source_subnetwork_ip_ranges_to_nat = "LIST_OF_SUBNETWORKS"
653   subnetwork {
654     name                    = google_compute_subnetwork.foobar.name
655     source_ip_ranges_to_nat = ["ALL_IP_RANGES"]
656   }
657   enable_endpoint_independent_mapping = %t
658   enable_dynamic_port_allocation = %t
659 }
660 `, routerName, routerName, routerName, routerName, routerName, enableEndpointIndependentMapping, enableDynamicPortAllocation)
661 }

yudoufu and others added 5 commits June 22, 2022 10:53
* Adding documentai processor

* Document AI Processor, not working due to unimplemented API methods?

* Remove default

* Remove default

* Add default version

* Fix test

* Use id over name, remove unused file

* Add note on delete
Co-authored-by: avinash84 <[email protected]>
roaks3 and others added 11 commits June 22, 2022 10:53
Temporarily remove myself from random reviewer script
* Corrected provider setup for a few cgc examples

* Cleaned up formatting
* feat: add in samples for pubsub tutorials for cloud run

refactor: switching to erb

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* refactor: remove extra cloud pubsub vars

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Update mmv1/templates/terraform/examples/cloud_run_service_pubsub.tf.erb

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…amicPortAllocation (#6155)

Support for the Dynamic Port Allocation feature (tracked in
terraform-google-modules/terraform-google-cloud-nat#64 and
hashicorp/terraform-provider-google#11052) was initially implemented
in #6022, but it lacked support for the maxPortsPerVm field. This
field is crucial to allow the full configuration to work.
@ScottSuarez
Copy link
Contributor

closing.. no changes...

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.