Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable "system" datasources #18

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions internal/provider/datasources.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// (C) Copyright 2024 Hewlett Packard Enterprise Development LP

//go:build !experimental

package provider

import (
"context"

"github.com/hashicorp/terraform-plugin-framework/datasource"
)

// DataSources defines the data sources implemented in the provider.
func (p *PCBeProvider) DataSources(
_ context.Context,
) []func() datasource.DataSource {
return []func() datasource.DataSource{}
}
20 changes: 20 additions & 0 deletions internal/provider/experimental_datasources.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// (C) Copyright 2024 Hewlett Packard Enterprise Development LP

//go:build experimental

package provider

import (
"context"
"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/datasources/system"
"github.com/hashicorp/terraform-plugin-framework/datasource"
)

// DataSources defines the data sources implemented in the provider.
func (p *PCBeProvider) DataSources(
_ context.Context,
) []func() datasource.DataSource {
return []func() datasource.DataSource{
system.NewDataSource,
}
}
8 changes: 0 additions & 8 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/client"
"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/constants"
"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/defaults"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/provider"
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
Expand Down Expand Up @@ -169,13 +168,6 @@ func (p *PCBeProvider) Configure(
resp.ResourceData = client
}

// DataSources defines the data sources implemented in the provider.
func (p *PCBeProvider) DataSources(
_ context.Context,
) []func() datasource.DataSource {
return []func() datasource.DataSource{}
}

// Resources defines the resources implemented in the provider.
func (p *PCBeProvider) Resources(
_ context.Context,
Expand Down
Loading