Skip to content

Commit

Permalink
Drop linode_reserved_ip resource and data sources in favor of linode_…
Browse files Browse the repository at this point in the history
…networking_ip (#1710)

* Drop reserved IP resources

* oops
  • Loading branch information
lgarber-akamai authored Jan 9, 2025
1 parent 0b2a918 commit 132c968
Show file tree
Hide file tree
Showing 22 changed files with 15 additions and 895 deletions.
5 changes: 0 additions & 5 deletions linode/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ import (
"github.com/linode/terraform-provider-linode/v2/linode/rdns"
"github.com/linode/terraform-provider-linode/v2/linode/region"
"github.com/linode/terraform-provider-linode/v2/linode/regions"
"github.com/linode/terraform-provider-linode/v2/linode/reservedip"
"github.com/linode/terraform-provider-linode/v2/linode/reservedips"
"github.com/linode/terraform-provider-linode/v2/linode/sshkey"
"github.com/linode/terraform-provider-linode/v2/linode/sshkeys"
"github.com/linode/terraform-provider-linode/v2/linode/stackscript"
Expand Down Expand Up @@ -231,7 +229,6 @@ func (p *FrameworkProvider) Resources(ctx context.Context) []func() resource.Res
placementgroup.NewResource,
placementgroupassignment.NewResource,
instancereservedipassignment.NewResource,
reservedip.NewResource,
rdns.NewResource,
sshkey.NewResource,
stackscript.NewResource,
Expand Down Expand Up @@ -311,7 +308,5 @@ func (p *FrameworkProvider) DataSources(ctx context.Context) []func() datasource
childaccount.NewDataSource,
childaccounts.NewDataSource,
networkingips.NewDataSource,
reservedip.NewDataSource,
reservedips.NewDataSource,
}
}
2 changes: 1 addition & 1 deletion linode/instance/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,7 @@ func TestAccResourceInstance_deleteWithReservedIP(t *testing.T) {
testRegion := "us-east"
reservedIP := ""
instanceName := acctest.RandomWithPrefix("tf_test")
ipResourceName := "linode_reserved_ip.test"
ipResourceName := "linode_networking_ip.test"
rootPass := acctest.RandString(16)
resource.Test(t, resource.TestCase{
PreCheck: func() { acceptance.PreCheck(t) },
Expand Down
5 changes: 4 additions & 1 deletion linode/instance/tmpl/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,11 @@ func WithReservedIP(t *testing.T, label, pubKey, region, rootPass string) string

func OnlyReservedIP(t *testing.T, region string) string {
return fmt.Sprintf(`
resource "linode_reserved_ip" "test" {
resource "linode_networking_ip" "test" {
type = "ipv4"
region = "%s"
public = true
reserved = true
}
`, region)
}
7 changes: 5 additions & 2 deletions linode/instance/tmpl/templates/instance_with_reserved_ip.gotf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

{{ template "e2e_test_firewall" . }}

resource "linode_reserved_ip" "test" {
resource "linode_networking_ip" "test" {
type = "ipv4"
region = "{{ .Region }}"
public = true
reserved = true
}

resource "linode_instance" "foobar" {
Expand All @@ -15,7 +18,7 @@ resource "linode_instance" "foobar" {
root_pass = "{{ .RootPass }}"
authorized_keys = ["{{ .PubKey }}"]

ipv4 = [linode_reserved_ip.test.address]
ipv4 = [linode_networking_ip.test.address]
}

{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ resource "linode_instance" "foobar" {
firewall_id = linode_firewall.e2e_test_firewall.id
}

resource "linode_reserved_ip" "test" {
resource "linode_networking_ip" "test" {
type = "ipv4"
region = "{{ .Region }}"
public = true
reserved = true
}

resource "linode_reserved_ip_assignment" "test" {
linode_id = linode_instance.foobar.id
public = true
address = linode_reserved_ip.test.address
address = linode_networking_ip.test.address
}

{{ end }}
54 changes: 0 additions & 54 deletions linode/reservedip/datasource_model.go

This file was deleted.

65 changes: 0 additions & 65 deletions linode/reservedip/datasource_schema.go

This file was deleted.

40 changes: 0 additions & 40 deletions linode/reservedip/datasource_test.go

This file was deleted.

48 changes: 0 additions & 48 deletions linode/reservedip/framework_datasource.go

This file was deleted.

66 changes: 0 additions & 66 deletions linode/reservedip/framework_models.go

This file was deleted.

Loading

0 comments on commit 132c968

Please sign in to comment.