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 labels property to HA VPN Gateway #12866

Merged
merged 17 commits into from
Feb 12, 2025

Conversation

cynicphoenix
Copy link
Contributor

@cynicphoenix cynicphoenix commented Jan 27, 2025

compute: added `labels` field to `google_compute_ha_vpn_gateway` resource

Copy link

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

@shuyama1, 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 shuyama1 January 27, 2025 09:56
@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 ( 4 files changed, 230 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 230 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

1 similar comment
@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 ( 4 files changed, 230 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 230 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1097
Passed tests: 1005
Skipped tests: 75
Affected tests: 17

Click here to see the affected service packages
  • compute

Action taken

Found 17 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeHaVpnGateway_haVpnGatewayBasicExample
  • TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example
  • TestAccComputeRouterInterface_withTunnel
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccComputeRouterPeer_EnableDisableIpv6
  • TestAccComputeRouterPeer_Ipv4BasicCreateUpdate
  • TestAccComputeRouterPeer_Ipv6Basic
  • TestAccComputeRouterPeer_UpdateIpv6Address
  • TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
  • TestAccComputeRouterPeer_addImportAndExportPolicy
  • TestAccComputeRouterPeer_advertiseMode
  • TestAccComputeRouterPeer_basic
  • TestAccComputeRouterPeer_bfd
  • TestAccComputeRouterPeer_enable
  • TestAccComputeVpnTunnel_router
  • TestAccDataSourceComputeHaVpnGateway
  • TestAccDataSourceComputeRouterStatus

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1097
Passed tests: 1005
Skipped tests: 75
Affected tests: 17

Click here to see the affected service packages
  • compute

Action taken

Found 17 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeHaVpnGateway_haVpnGatewayBasicExample
  • TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example
  • TestAccComputeRouterInterface_withTunnel
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccComputeRouterPeer_EnableDisableIpv6
  • TestAccComputeRouterPeer_Ipv4BasicCreateUpdate
  • TestAccComputeRouterPeer_Ipv6Basic
  • TestAccComputeRouterPeer_UpdateIpv6Address
  • TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
  • TestAccComputeRouterPeer_addImportAndExportPolicy
  • TestAccComputeRouterPeer_advertiseMode
  • TestAccComputeRouterPeer_basic
  • TestAccComputeRouterPeer_bfd
  • TestAccComputeRouterPeer_enable
  • TestAccComputeVpnTunnel_router
  • TestAccDataSourceComputeHaVpnGateway
  • TestAccDataSourceComputeRouterStatus

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeHaVpnGateway_haVpnGatewayBasicExample [Debug log]
TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example [Debug log]
TestAccComputeRouterInterface_withTunnel [Debug log]
TestAccComputeRouterPeer_AddMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_EnableDisableIpv6 [Debug log]
TestAccComputeRouterPeer_Ipv4BasicCreateUpdate [Debug log]
TestAccComputeRouterPeer_Ipv6Basic [Debug log]
TestAccComputeRouterPeer_UpdateIpv6Address [Debug log]
TestAccComputeRouterPeer_UpdateMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_addImportAndExportPolicy [Debug log]
TestAccComputeRouterPeer_advertiseMode [Debug log]
TestAccComputeRouterPeer_basic [Debug log]
TestAccComputeRouterPeer_bfd [Debug log]
TestAccComputeRouterPeer_enable [Debug log]
TestAccComputeVpnTunnel_router [Debug log]
TestAccDataSourceComputeHaVpnGateway [Debug log]
TestAccDataSourceComputeRouterStatus [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

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeHaVpnGateway_haVpnGatewayBasicExample [Debug log]
TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example [Debug log]
TestAccComputeRouterInterface_withTunnel [Debug log]
TestAccComputeRouterPeer_AddMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_EnableDisableIpv6 [Debug log]
TestAccComputeRouterPeer_Ipv4BasicCreateUpdate [Debug log]
TestAccComputeRouterPeer_Ipv6Basic [Debug log]
TestAccComputeRouterPeer_UpdateIpv6Address [Debug log]
TestAccComputeRouterPeer_UpdateMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_addImportAndExportPolicy [Debug log]
TestAccComputeRouterPeer_advertiseMode [Debug log]
TestAccComputeRouterPeer_basic [Debug log]
TestAccComputeRouterPeer_bfd [Debug log]
TestAccComputeRouterPeer_enable [Debug log]
TestAccComputeVpnTunnel_router [Debug log]
TestAccDataSourceComputeHaVpnGateway [Debug log]
TestAccDataSourceComputeRouterStatus [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

@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 ( 4 files changed, 230 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 230 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@harshithpatte-g
Copy link
Contributor

@cynicphoenix if label fields are mutable, can we add update tests?

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1097
Passed tests: 1022
Skipped tests: 75
Affected tests: 0

Click here to see the affected service packages
  • compute

🟢 All tests passed!

View the build log

@cynicphoenix cynicphoenix marked this pull request as draft January 27, 2025 11:14
@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 ( 5 files changed, 296 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 296 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute
#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccComputeHaVpnGateway_updateLabels
    🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@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 ( 5 files changed, 293 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 293 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • compute
#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccComputeHaVpnGateway_updateLabels
    🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@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 ( 5 files changed, 294 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 294 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@cynicphoenix cynicphoenix marked this pull request as ready for review January 30, 2025 05:29
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1098
Passed tests: 1022
Skipped tests: 75
Affected tests: 1

Click here to see the affected service packages
  • compute

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeHaVpnGateway_updateLabels [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

@@ -0,0 +1,62 @@
package compute_test
Copy link
Member

Choose a reason for hiding this comment

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

Please rename the test file to resource_compute_ha_vpn_gateway_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed,

resource "google_compute_ha_vpn_gateway" "ha_gateway1" {
region = "us-central1"
name = "tf-test-ha-vpn-1%s"
network = google_compute_network.network1.id
Copy link
Member

Choose a reason for hiding this comment

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

Test failed with the following error:

resource_compute_ha_vpn_gateway_labels_test.go:19: Step 1/4 error: Error running pre-apply refresh: exit status 1
        
        Error: Reference to undeclared resource
        
          on terraform_plugin_test.tf line 5, in resource "google_compute_ha_vpn_gateway" "ha_gateway1":
           5:   network  = google_compute_network.network1.id
        
        A managed resource "google_compute_network" "network1" has not been declared
        in the root module.

You'll need to create a dependent resource google_compute_network inline so it can be referenced. Please see the generated tests as examples. https://github.com/hashicorp/terraform-provider-google-beta/blob/main/google-beta/services/compute/resource_compute_ha_vpn_gateway_generated_test.go#L66

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added network resource

@github-actions github-actions bot requested a review from shuyama1 February 3, 2025 06:15
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1101
Passed tests: 1025
Skipped tests: 75
Affected tests: 1

Click here to see the affected service packages
  • compute

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeHaVpnGateway_updateLabels [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

@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 ( 5 files changed, 366 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 366 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1101
Passed tests: 1008
Skipped tests: 75
Affected tests: 18

Click here to see the affected service packages
  • compute

Action taken

Found 18 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeHaVpnGateway_haVpnGatewayBasicExample
  • TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example
  • TestAccComputeHaVpnGateway_updateLabels
  • TestAccComputeRouterInterface_withTunnel
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccComputeRouterPeer_EnableDisableIpv6
  • TestAccComputeRouterPeer_Ipv4BasicCreateUpdate
  • TestAccComputeRouterPeer_Ipv6Basic
  • TestAccComputeRouterPeer_UpdateIpv6Address
  • TestAccComputeRouterPeer_UpdateMd5AuthenticationKey
  • TestAccComputeRouterPeer_addImportAndExportPolicy
  • TestAccComputeRouterPeer_advertiseMode
  • TestAccComputeRouterPeer_basic
  • TestAccComputeRouterPeer_bfd
  • TestAccComputeRouterPeer_enable
  • TestAccComputeVpnTunnel_router
  • TestAccDataSourceComputeHaVpnGateway
  • TestAccDataSourceComputeRouterStatus

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeHaVpnGateway_haVpnGatewayBasicExample [Debug log]
TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example [Debug log]
TestAccComputeRouterInterface_withTunnel [Debug log]
TestAccComputeRouterPeer_AddMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_EnableDisableIpv6 [Debug log]
TestAccComputeRouterPeer_Ipv4BasicCreateUpdate [Debug log]
TestAccComputeRouterPeer_Ipv6Basic [Debug log]
TestAccComputeRouterPeer_UpdateIpv6Address [Debug log]
TestAccComputeRouterPeer_UpdateMd5AuthenticationKey [Debug log]
TestAccComputeRouterPeer_addImportAndExportPolicy [Debug log]
TestAccComputeRouterPeer_advertiseMode [Debug log]
TestAccComputeRouterPeer_basic [Debug log]
TestAccComputeRouterPeer_bfd [Debug log]
TestAccComputeRouterPeer_enable [Debug log]
TestAccComputeVpnTunnel_router [Debug log]
TestAccDataSourceComputeHaVpnGateway [Debug log]
TestAccDataSourceComputeRouterStatus [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeHaVpnGateway_updateLabels [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

@cynicphoenix cynicphoenix marked this pull request as draft February 5, 2025 04:36
@cynicphoenix
Copy link
Contributor Author

Hey @shuyama1 I was testing some changes as the test was failing. Test seems to be correct.
I investigated and found that the update label/set label is not working via gCloud, or even through gCurl (directly hitting REST APIs).

@cynicphoenix
Copy link
Contributor Author

Created a bug for update label issue in vpn gateways: b/394492874
Removed update-label test from this PR. Created a new bug for update-label test for vpn gateways: b/392769050
Will add update-label test once update-label issue is resolved.

@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 ( 6 files changed, 232 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 6 files changed, 232 insertions(+), 4 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1101
Passed tests: 1024
Skipped tests: 75
Affected tests: 2

Click here to see the affected service packages
  • compute

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
  • TestAccComputeHaVpnGateway_haVpnGatewayBasicExample
  • TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeHaVpnGateway_haVpnGatewayBasicExample [Debug log]
TestAccComputeHaVpnGateway_haVpnGatewayIpv6Example [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

@shuyama1 shuyama1 marked this pull request as ready for review February 11, 2025 17:24
Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. Only one small comment, thank you!

@@ -2,6 +2,9 @@ resource "google_compute_ha_vpn_gateway" "ha_gateway1" {
region = "us-central1"
name = "{{index $.Vars "ha_vpn_gateway1_name"}}"
network = google_compute_network.network1.id
labels = {
Copy link
Member

Choose a reason for hiding this comment

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

We'd aim for only minimal configuration in the basic example - including only required fields. It would be fine to have test coverage in ha_vpn_gateway_ipv6 only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@github-actions github-actions bot requested a review from shuyama1 February 12, 2025 06:41
@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 ( 4 files changed, 224 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 4 files changed, 224 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 27 insertions(+))
Open in Cloud Shell: Diff ( 1 file changed, 3 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1105
Passed tests: 1029
Skipped tests: 75
Affected tests: 1

Click here to see the affected service packages
  • compute

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeHaVpnGateway_haVpnGatewayBasicExample [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

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.

4 participants