This commit is contained in:
2023-10-24 11:54:34 -04:00
parent dfd2240fff
commit 689069921a
2 changed files with 12 additions and 12 deletions

View File

@@ -16,11 +16,11 @@ import (
"path" "path"
) )
// Ensure ScaffoldingProvider satisfies various provider interfaces. // Ensure VirtfusionProvider satisfies various provider interfaces.
var _ provider.Provider = &ScaffoldingProvider{} var _ provider.Provider = &VirtfusionProvider{}
// ScaffoldingProvider defines the provider implementation. // VirtfusionProvider defines the provider implementation.
type ScaffoldingProvider struct { type VirtfusionProvider struct {
// version is set to the provider version on release, "dev" when the // version is set to the provider version on release, "dev" when the
// provider is built and ran locally, and "test" when running acceptance // provider is built and ran locally, and "test" when running acceptance
// testing. // testing.
@@ -33,12 +33,12 @@ type ScaffoldingProviderModel struct {
ApiToken types.String `tfsdk:"api_token"` ApiToken types.String `tfsdk:"api_token"`
} }
func (p *ScaffoldingProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) { func (p *VirtfusionProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) {
resp.TypeName = "virtfusion" resp.TypeName = "virtfusion"
resp.Version = p.version resp.Version = p.version
} }
func (p *ScaffoldingProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { func (p *VirtfusionProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = schema.Schema{ resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{ Attributes: map[string]schema.Attribute{
"endpoint": schema.StringAttribute{ "endpoint": schema.StringAttribute{
@@ -53,7 +53,7 @@ func (p *ScaffoldingProvider) Schema(ctx context.Context, req provider.SchemaReq
} }
} }
func (p *ScaffoldingProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { func (p *VirtfusionProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
// Check environment variables // Check environment variables
apiToken := os.Getenv("VIRTFUSION_API_TOKEN") apiToken := os.Getenv("VIRTFUSION_API_TOKEN")
endpoint := os.Getenv("VIRTFUSION_ENDPOINT") endpoint := os.Getenv("VIRTFUSION_ENDPOINT")
@@ -112,7 +112,7 @@ func (p *ScaffoldingProvider) Configure(ctx context.Context, req provider.Config
resp.ResourceData = client resp.ResourceData = client
} }
func (p *ScaffoldingProvider) Resources(ctx context.Context) []func() resource.Resource { func (p *VirtfusionProvider) Resources(ctx context.Context) []func() resource.Resource {
return []func() resource.Resource{ return []func() resource.Resource{
NewVirtfusionServerResource, NewVirtfusionServerResource,
NewVirtfusionServerBuildResource, NewVirtfusionServerBuildResource,
@@ -120,7 +120,7 @@ func (p *ScaffoldingProvider) Resources(ctx context.Context) []func() resource.R
} }
} }
func (p *ScaffoldingProvider) DataSources(ctx context.Context) []func() datasource.DataSource { func (p *VirtfusionProvider) DataSources(ctx context.Context) []func() datasource.DataSource {
return []func() datasource.DataSource{} return []func() datasource.DataSource{}
} }
@@ -140,7 +140,7 @@ func (c *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error) {
func New(version string) func() provider.Provider { func New(version string) func() provider.Provider {
return func() provider.Provider { return func() provider.Provider {
return &ScaffoldingProvider{ return &VirtfusionProvider{
version: version, version: version,
} }
} }

View File

@@ -26,7 +26,7 @@ import (
var ( var (
// these will be set by the goreleaser configuration // these will be set by the goreleaser configuration
// to appropriate values for the compiled binary. // to appropriate values for the compiled binary.
version string = "0.0.2-dev" version string = "0.0.3"
// goreleaser can pass other information to the main package, such as the specific commit // goreleaser can pass other information to the main package, such as the specific commit
// https://goreleaser.com/cookbooks/using-main.version/ // https://goreleaser.com/cookbooks/using-main.version/
@@ -40,7 +40,7 @@ func main() {
opts := providerserver.ServeOpts{ opts := providerserver.ServeOpts{
// TODO: Update this string with the published name of your provider. // TODO: Update this string with the published name of your provider.
Address: "registry.terraform.io/hashicorp/scaffolding", Address: "registry.terraform.io/EZSCALE/virtfusion",
Debug: debug, Debug: debug,
} }