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

add support for inter-VPC communications in router_nat resource #9007

Merged
merged 8 commits into from
Sep 25, 2023

Conversation

felipegc
Copy link
Contributor

@felipegc felipegc commented Sep 19, 2023

Fixes: Fixes: hashicorp/terraform-provider-google#15902

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: added `type` field to `google_compute_router_nat` resource (beta)
compute: added `rules.action.source_nat_active_ranges` field to `google_compute_router_nat` resource (beta)
compute: added `rules.action.source_nat_drain_ranges` field to `google_compute_router_nat` resource (beta)

@felipegc felipegc marked this pull request as draft September 19, 2023 21:09
@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will require approval to run.

@hao-nan-li, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 19, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 62 insertions(+), 15 deletions(-))
Terraform Beta: Diff ( 3 files changed, 177 insertions(+), 15 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3076
Passed tests 2772
Skipped tests: 300
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_withPrivateNat|TestAccComputeRouterNat_withPortAllocationMethods|TestAccComputeRouterNat_withManualIpAndSubnetConfiguration|TestAccDataprocClusterIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNat_withPrivateNat[Debug log]
TestAccDataprocClusterIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeRouterNat_withPortAllocationMethods[Error message] [Debug log]
TestAccComputeRouterNat_withManualIpAndSubnetConfiguration[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 20, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 63 insertions(+), 15 deletions(-))
Terraform Beta: Diff ( 3 files changed, 179 insertions(+), 15 deletions(-))

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 21, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 132 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 473 insertions(+), 16 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  rules {
    action {
      source_nat_active_ranges = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3079
Passed tests 2771
Skipped tests: 299
Affected tests: 9

Action taken

Found 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_withPrivateNatAndRules|TestAccComputeRouterNat_withNatRules|TestAccComputeRouterNat_withPortAllocationMethods|TestAccComputeRouterNat_withManualIpAndSubnetConfiguration|TestAccComputeRouterNat_withNatIpsAndDrainNatIps|TestAccComputeRouterNat_update|TestAccComputeRouterNat_removeLogConfig|TestAccComputeRouterNat_basic|TestAccDataSourceGoogleComputeRouterNat_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNat_withPrivateNatAndRules[Debug log]
TestAccComputeRouterNat_withNatRules[Debug log]
TestAccComputeRouterNat_withPortAllocationMethods[Debug log]
TestAccComputeRouterNat_withManualIpAndSubnetConfiguration[Debug log]
TestAccComputeRouterNat_withNatIpsAndDrainNatIps[Debug log]
TestAccComputeRouterNat_update[Debug log]
TestAccComputeRouterNat_removeLogConfig[Debug log]
TestAccComputeRouterNat_basic[Debug log]
TestAccDataSourceGoogleComputeRouterNat_basic[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 22, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 80 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 500 insertions(+), 16 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  rules {
    action {
      source_nat_active_ranges = # value needed
      source_nat_drain_ranges  = # value needed
    }
  }
}

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 22, 2023
@felipegc felipegc changed the title add support for type field in router_nat resource add support for inter-VPC communications in router_nat resource Sep 22, 2023
@felipegc felipegc marked this pull request as ready for review September 22, 2023 18:33
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3081
Passed tests 2781
Skipped tests: 299
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeRouterNat_withPrivateNatAndRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeRouterNat_withPrivateNatAndRules[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 22, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 119 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 539 insertions(+), 16 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  rules {
    action {
      source_nat_active_ranges = # value needed
      source_nat_drain_ranges  = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3081
Passed tests 2781
Skipped tests: 299
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataprocClusterIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocClusterIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

- !ruby/object:Provider::Terraform::Examples
name: 'router_nat_private'
primary_resource_id: 'nat_type'
skip_test: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason to skip this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap. There is no generated_test for this resource. All tests are like this one and I put one test here to serve as an example and documentation for the users who may use this new feature.

@@ -128,7 +140,7 @@ properties:
function: 'verify.ValidateRFC1035Name(2, 63)'
- !ruby/object:Api::Type::Enum
name: 'natIpAllocateOption'
required: true
required: false
Copy link
Contributor

Choose a reason for hiding this comment

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

If this field is no longer required, what is the default behaviour for an empty field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say not sending the field through the request. For example: if you try to set this field while using the "type=PRIVATE" the api return an error with the following message: "Error creating RouterNat: googleapi: Error 400: Invalid value for field 'resource.nats[0].natIpAllocateOption': 'MANUAL_ONLY'. Setting natIpAllocateOption is unsupported with type=PRIVATE."

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 25, 2023
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 2 files changed, 119 insertions(+), 16 deletions(-))
Terraform Beta: Diff ( 3 files changed, 539 insertions(+), 16 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_router_nat (11 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_router_nat" "primary" {
  rules {
    action {
      source_nat_active_ranges = # value needed
      source_nat_drain_ranges  = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3083
Passed tests 2784
Skipped tests: 299
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

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.

Add support for inter-VPC communications
3 participants