Skip to content

Commit

Permalink
fixing version == beta to unless version = ga (GoogleCloudPlatform#9922)
Browse files Browse the repository at this point in the history
  • Loading branch information
unnatinadupalli authored Feb 6, 2024
1 parent 7088e24 commit ba34f46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func flattenNetworkInterfaces(d *schema.ResourceData, config *transport_tpg.Conf
internalIP = iface.NetworkIP
}

<% if version == "beta" -%>
<% unless version == 'ga' -%>
if iface.NetworkAttachment != "" {
networkAttachment, err := tpgresource.GetRelativePath(iface.NetworkAttachment)
if err != nil {
Expand Down Expand Up @@ -447,7 +447,7 @@ func expandNetworkInterfaces(d tpgresource.TerraformResourceData, config *transp
data := raw.(map[string]interface{})


<% if version == "beta" -%>
<% unless version == 'ga' -%>
var networkAttachment = ""
network := data["network"].(string)
subnetwork := data["subnetwork"].(string)
Expand Down Expand Up @@ -483,7 +483,7 @@ func expandNetworkInterfaces(d tpgresource.TerraformResourceData, config *transp
ifaces[i] = &compute.NetworkInterface{
NetworkIP: data["network_ip"].(string),
Network: nf.RelativeLink(),
<% if version == "beta" -%>
<% unless version == 'ga' -%>
NetworkAttachment: networkAttachment,
<% end -%>
Subnetwork: sf.RelativeLink(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func ResourceComputeInstance() *schema.Resource {
Description: `The name or self_link of the subnetwork attached to this interface.`,
},

<% if version == "beta" -%>
<% unless version == 'ga' -%>
"network_attachment": {
Type: schema.TypeString,
Optional: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ func TestAccComputeInstanceTemplate_sourceImageEncryptionKey(t *testing.T) {
})
}

<% if version == "beta" -%>
<% unless version == 'ga' -%>
func TestAccComputeInstanceTemplate_NetworkAttachment(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1720,7 +1720,7 @@ func testAccCheckComputeInstanceTemplateHasMinCpuPlatform(instanceTemplate *comp
}
}

<% if version == "beta" -%>
<% unless version == 'ga' -%>
func testAccCheckComputeInstanceTemplateHasNetworkAttachment(instanceTemplate *compute.InstanceTemplate, networkAttachmentName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
for _, networkInterface := range instanceTemplate.Properties.NetworkInterfaces {
Expand Down Expand Up @@ -3878,7 +3878,7 @@ resource "google_compute_instance_template" "foobar" {
`, context)
}

<% if version == "beta" -%>
<% unless version == 'ga' -%>
func testAccComputeInstanceTemplate_network_attachment(context map[string]interface{}) string {
return acctest.Nprintf(`
data "google_compute_image" "my_image" {
Expand Down

0 comments on commit ba34f46

Please sign in to comment.