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

Update Network Connectivity Spoke Router and VPN Tunnels #12519

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

r-teller
Copy link
Contributor

@r-teller r-teller commented Dec 7, 2024

  • Remove immutable flag from VPN Tunnels to support:
    • includeImportRanges updates
  • Remove immutable flag from Router Appliances to support:
    • Instance count updates
    • includeImportRanges updates
  • Add correct update_mask_fields for VPN Tunnels and Router Appliances
  • Fix Router Appliance instance attributes to be properly marked as required
  • Update tests to verify:
    • Router Appliance scaling from 1 to 2 instances
    • Import range modifications
      Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

networkconnectivity: added support for updating `linked_vpn_tunnels.include_import_ranges`, `linked_interconnect_attachments.include_import_ranges`, `linked_router_appliance_instances. instances` and `linked_router_appliance_instances.include_import_ranges` in `google_network_connectivity_spoke`
networkconnectivity: fixed `linked_router_appliance_instances.instances.virtual_machine` and `linked_router_appliance_instances.instances.ip_address` attributes in `google_network_connectivity_spoke` to be correctly marked as required. Otherwise the request to create the resource will fail.

… configurations

- Remove immutable flag from VPN Tunnels to support:
  * includeImportRanges updates
- Remove immutable flag from Router Appliances to support:
  * Instance count updates
  * includeImportRanges updates
- Add correct update_mask_fields for VPN Tunnels and Router Appliances
- Fix Router Appliance instance attributes to be properly marked as required
- Update tests to verify:
  * Router Appliance scaling from 1 to 2 instances
  * Import range modifications
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Dec 7, 2024
Copy link

github-actions bot commented Dec 7, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@zli82016, 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.

@github-actions github-actions bot requested a review from zli82016 December 7, 2024 08:16
@r-teller
Copy link
Contributor Author

r-teller commented Dec 7, 2024

Before Change

 # module.usw1_appliance-vyoss.module.gcp_ncc_appliance_spoke_vyos["spoke-lan-vyos-transit-1ncc-usw1"].google_network_connectivity_spoke.ncc_spoke must be replaced
-/+ resource "google_network_connectivity_spoke" "ncc_spoke" {
      ~ create_time      = "2024-12-07T16:47:44.381551298Z" -> (known after apply)
      ~ hub              = "projects/rteller-demo-hst-e265-aaaa/locations/global/hubs/hub-lan-1ncc-gbl0" -> "hub-lan-1ncc-gbl0"
      ~ id               = "projects/rteller-demo-hst-e265-aaaa/locations/us-west1/spokes/spoke-lan-vyos-transit-1ncc-usw1" -> (known after apply)
      - labels           = {} -> null
      ~ name             = "projects/rteller-demo-hst-e265-aaaa/locations/us-west1/spokes/spoke-lan-vyos-transit-1ncc-usw1" -> "spoke-lan-vyos-transit-1ncc-usw1"
      ~ state            = "ACTIVE" -> (known after apply)
      ~ unique_id        = "c79f20f2-ae8d-46e0-98a5-addef5c406b6" -> (known after apply)
      ~ update_time      = "2024-12-07T16:56:41.257471932Z" -> (known after apply)
        # (5 unchanged attributes hidden)

      ~ linked_router_appliance_instances {
          - include_import_ranges      = [] -> null
            # (1 unchanged attribute hidden)

          - instances { # forces replacement
              - ip_address      = "172.16.0.23" -> null # forces replacement
              - virtual_machine = "https://www.googleapis.com/compute/v1/projects/rteller-demo-hst-e265-aaaa/zones/us-west1-a/instances/lan-vyos-transit-usw1-1ncc-01" -> null # forces replacement
            }

            # (1 unchanged block hidden)
        }
    }

After Change

  # module.usw1_appliance-vyoss.module.gcp_ncc_appliance_spoke_vyos["spoke-lan-vyos-transit-1ncc-usw1"].google_network_connectivity_spoke.ncc_spoke will be updated in-place      
  ~ resource "google_network_connectivity_spoke" "ncc_spoke" {
        id               = "projects/rteller-demo-hst-e265-aaaa/locations/us-west1/spokes/spoke-lan-vyos-transit-1ncc-usw1"
        name             = "projects/rteller-demo-hst-e265-aaaa/locations/us-west1/spokes/spoke-lan-vyos-transit-1ncc-usw1"
        # (11 unchanged attributes hidden)

      ~ linked_router_appliance_instances {
            # (2 unchanged attributes hidden)

          - instances {
              - ip_address      = "172.16.0.23" -> null
              - virtual_machine = "https://www.googleapis.com/compute/v1/projects/rteller-demo-hst-e265-aaaa/zones/us-west1-a/instances/lan-vyos-transit-usw1-1ncc-01" -> null    
            }

            # (1 unchanged block hidden)
        }
    }

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Dec 9, 2024
@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.

google provider: Diff ( 3 files changed, 223 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 3 files changed, 223 insertions(+), 16 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field linked_router_appliance_instances.instances.ip_address changed from optional to required on google_network_connectivity_spoke - reference
  • Field linked_router_appliance_instances.instances.virtual_machine changed from optional to required on google_network_connectivity_spoke - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 28
Passed tests: 25
Skipped tests: 1
Affected tests: 2

Click here to see the affected service packages
  • networkconnectivity

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccNetworkConnectivitySpoke_RouterApplianceHandWritten [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccNetworkConnectivitySpoke_RouterApplianceHandWrittenLongForm [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@github-actions github-actions bot requested a review from zli82016 December 9, 2024 20:06
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Dec 9, 2024
@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.

google provider: Diff ( 3 files changed, 228 insertions(+), 21 deletions(-))
google-beta provider: Diff ( 3 files changed, 228 insertions(+), 21 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field linked_router_appliance_instances.instances.ip_address changed from optional to required on google_network_connectivity_spoke - reference
  • Field linked_router_appliance_instances.instances.virtual_machine changed from optional to required on google_network_connectivity_spoke - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 28
Passed tests: 26
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • networkconnectivity

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
  • TestAccNetworkConnectivitySpoke_RouterApplianceHandWrittenLongForm

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccNetworkConnectivitySpoke_RouterApplianceHandWrittenLongForm [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

…hments in Spoke

Changes:
- Remove immutable: true from linkedVpnTunnels and linkedInterconnectAttachments
- Add TestAccNetworkConnectivitySpoke_VPNTunnelHandWritten test
- Add TestAccNetworkConnectivitySpoke_InterconnectAttachmentHandWritten test
@github-actions github-actions bot requested a review from zli82016 December 10, 2024 06:41
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Dec 10, 2024
@zli82016 zli82016 changed the title Update Network Connectivity Spoke Router and VPN resource for mutable… Update Network Connectivity Spoke Router and VPN Tunnels Dec 10, 2024
@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.

google provider: Diff ( 3 files changed, 608 insertions(+), 23 deletions(-))
google-beta provider: Diff ( 3 files changed, 608 insertions(+), 23 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field linked_router_appliance_instances.instances.ip_address changed from optional to required on google_network_connectivity_spoke - reference
  • Field linked_router_appliance_instances.instances.virtual_machine changed from optional to required on google_network_connectivity_spoke - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 30
Passed tests: 27
Skipped tests: 1
Affected tests: 2

Click here to see the affected service packages
  • networkconnectivity

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccNetworkConnectivitySpoke_InterconnectAttachmentHandWrittenHandWritten [Debug log]
TestAccNetworkConnectivitySpoke_VPNTunnelHandWrittenHandWritten [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

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

LGTM

@zli82016 zli82016 merged commit 3a54268 into GoogleCloudPlatform:main Dec 10, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants