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

Added stack_type (enum) and gateway_ip_version (enum) to HAVPN resource #11036

Merged
merged 8 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions mmv1/products/compute/HaVpnGateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ properties:
values:
- :IPV4_ONLY
- :IPV4_IPV6
- :IPV6_ONLY
immutable: true
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
- !ruby/object:Api::Type::Enum
name: 'gatewayIpVersion'
description: |
The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used.
default_value: :IPV4
Copy link
Collaborator

Choose a reason for hiding this comment

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

with this field having a default value, let's add a test case that ensures that the default value is in fact IPV4 to prevent future changes from breaking the 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.

Added a check for default value. Removed manually setting the values in the config string.

Copy link
Collaborator

Choose a reason for hiding this comment

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

although you did add a test case for the default value, we should also have a case where the user explicitly sets the gateway_ip_version this is the reason for the vcr message:

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

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

```hcl
resource "google_compute_ha_vpn_gateway" "primary" {
  gateway_ip_version = # value needed
}

values:
- :IPV4
- :IPV6
immutable: true
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
- !ruby/object:Api::Type::Array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func testAccDataSourceComputeHaVpnGatewayConfig(gwName string) string {
resource "google_compute_ha_vpn_gateway" "ha_gateway" {
name = "%s"
network = google_compute_network.network1.id
stack_type = "IPV4_ONLY"
gateway_ip_version = "IPV4"
}

resource "google_compute_network" "network1" {
Expand Down
Loading