Skip to content

Commit

Permalink
Remove beta self link addition
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick committed Jun 11, 2019
1 parent d7c5440 commit 4975752
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions templates/terraform/resource.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
Expand Down
5 changes: 0 additions & 5 deletions third_party/terraform/utils/self_link_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4975752

Please sign in to comment.