Skip to content

Commit

Permalink
refactor: move data.hcloud_server_type(s) to Plugin Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Sep 10, 2024
1 parent 3da0a47 commit 79a9d03
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 164 deletions.
3 changes: 3 additions & 0 deletions hcloud/plugin_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/terraform-provider-hcloud/internal/datacenter"
"github.com/hetznercloud/terraform-provider-hcloud/internal/location"
"github.com/hetznercloud/terraform-provider-hcloud/internal/servertype"
"github.com/hetznercloud/terraform-provider-hcloud/internal/sshkey"
"github.com/hetznercloud/terraform-provider-hcloud/internal/util/tflogutil"
)
Expand Down Expand Up @@ -172,6 +173,8 @@ func (p *PluginProvider) DataSources(_ context.Context) []func() datasource.Data
datacenter.NewDataSourceList,
location.NewDataSource,
location.NewDataSourceList,
servertype.NewDataSource,
servertype.NewDataSourceList,
sshkey.NewDataSource,
sshkey.NewDataSourceList,
}
Expand Down
3 changes: 0 additions & 3 deletions hcloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/hetznercloud/terraform-provider-hcloud/internal/network"
"github.com/hetznercloud/terraform-provider-hcloud/internal/rdns"
"github.com/hetznercloud/terraform-provider-hcloud/internal/server"
"github.com/hetznercloud/terraform-provider-hcloud/internal/servertype"
"github.com/hetznercloud/terraform-provider-hcloud/internal/volume"
)

Expand Down Expand Up @@ -118,8 +117,6 @@ func Provider() *schema.Provider {
placementgroup.DataSourceListType: placementgroup.DataSourceList(),
server.DataSourceType: server.DataSource(),
server.DataSourceListType: server.DataSourceList(),
servertype.DataSourceType: servertype.DataSource(),
servertype.DataSourceListType: servertype.ServerTypesDataSource(),
volume.DataSourceType: volume.DataSource(),
volume.DataSourceListType: volume.DataSourceList(),
},
Expand Down
3 changes: 0 additions & 3 deletions hcloud/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/hetznercloud/terraform-provider-hcloud/internal/primaryip"
"github.com/hetznercloud/terraform-provider-hcloud/internal/rdns"
"github.com/hetznercloud/terraform-provider-hcloud/internal/server"
"github.com/hetznercloud/terraform-provider-hcloud/internal/servertype"
"github.com/hetznercloud/terraform-provider-hcloud/internal/snapshot"
"github.com/hetznercloud/terraform-provider-hcloud/internal/volume"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -81,8 +80,6 @@ func TestProvider_DataSources(t *testing.T) {
placementgroup.DataSourceListType,
server.DataSourceType,
server.DataSourceListType,
servertype.DataSourceType,
servertype.DataSourceListType,
volume.DataSourceType,
volume.DataSourceListType,
}
Expand Down
Loading

0 comments on commit 79a9d03

Please sign in to comment.