Skip to content

Commit

Permalink
Added file to trigger google-only failure
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath committed Mar 21, 2024
1 parent d874e11 commit 0e44860
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-google/google/verify"
"google.golang.org/api/googleapi"

<% if version == "ga" -%>
Expand Down Expand Up @@ -80,6 +81,15 @@ func ResourceComputeRouterInterface() *schema.Resource {
AtLeastOneOf: []string{"ip_range", "interconnect_attachment", "subnetwork", "vpn_tunnel"},
Description: `The IP address and range of the interface. The IP range must be in the RFC3927 link-local IP space. Changing this forces a new interface to be created.`,
},
<% unless version == 'ga' -%>
"ip_version": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: verify.ValidateEnum([]string{"IPV4", "IPV6"}),
Description: `IP version of this interface.`,
},
<% end -%>
"private_ip_address": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -178,6 +188,12 @@ func resourceComputeRouterInterfaceCreate(d *schema.ResourceData, meta interface
iface.IpRange = ipRangeVal.(string)
}

<% unless version == 'ga' -%>
if ipVersionVal, ok := d.GetOk("ip_version"); ok {
iface.IpVersion = ipVersionVal.(string)
}
<% end -%>

if privateIpVal, ok := d.GetOk("private_ip_address"); ok {
iface.PrivateIpAddress = privateIpVal.(string)
}
Expand Down Expand Up @@ -269,6 +285,11 @@ func resourceComputeRouterInterfaceRead(d *schema.ResourceData, meta interface{}
if err := d.Set("ip_range", iface.IpRange); err != nil {
return fmt.Errorf("Error setting ip_range: %s", err)
}
<% unless version == 'ga' -%>
if err := d.Set("ip_version", iface.IpVersion); err != nil {
return fmt.Errorf("Error setting ip_version: %s", err)
}
<% end -%>
if err := d.Set("private_ip_address", iface.PrivateIpAddress); err != nil {
return fmt.Errorf("Error setting private_ip_address: %s", err)
}
Expand Down

0 comments on commit 0e44860

Please sign in to comment.