From 497575211bb17885c56b7a7e415b066f51675416 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Tue, 11 Jun 2019 13:07:10 -0700 Subject: [PATCH] Remove beta self link addition --- products/compute/api.yaml | 5 ++++- templates/terraform/resource.erb | 4 ---- third_party/terraform/utils/self_link_helpers.go | 5 ----- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/products/compute/api.yaml b/products/compute/api.yaml index 00ae6ce5dd0e..f2bac49902ea 100644 --- a/products/compute/api.yaml +++ b/products/compute/api.yaml @@ -8118,8 +8118,11 @@ objects: input: true send_empty_value: true min_version: beta - - !ruby/object:Api::Type::String + - !ruby/object:Api::Type::ResourceRef name: 'peerExternalGateway' + resource: 'ExternalVpnGateway' + imports: 'selfLink' + input: true description: | URL of the peer side external VPN gateway to which this VPN tunnel is connected. min_version: beta diff --git a/templates/terraform/resource.erb b/templates/terraform/resource.erb index ee117d4a07f1..27e69179d696 100644 --- a/templates/terraform/resource.erb +++ b/templates/terraform/resource.erb @@ -269,11 +269,7 @@ res, err := sendRequest(config, "<%= object.read_verb.to_s.upcase -%>", url, nil <% end -%> <% end -%> <% if object.has_self_link -%> -<% if version == "ga" -%> if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { -<% else -%> - if err := d.Set("self_link", ConvertSelfLinkToBeta(res["selfLink"].(string))); err != nil { -<% end -%> return fmt.Errorf("Error reading <%= object.name -%>: %s", err) } <% end -%> diff --git a/third_party/terraform/utils/self_link_helpers.go b/third_party/terraform/utils/self_link_helpers.go index 505e5dd76d78..1ae06e1fd1af 100644 --- a/third_party/terraform/utils/self_link_helpers.go +++ b/third_party/terraform/utils/self_link_helpers.go @@ -75,11 +75,6 @@ func ConvertSelfLinkToV1(link string) string { return reg.ReplaceAllString(link, "/compute/v1/projects/") } -func ConvertSelfLinkToBeta(link string) string { - reg := regexp.MustCompile("/compute/[a-zA-Z0-9]*/projects/") - return reg.ReplaceAllString(link, "/compute/beta/projects/") -} - func GetResourceNameFromSelfLink(link string) string { parts := strings.Split(link, "/") return parts[len(parts)-1]