From 6844355a928b60ffb1006e6b1d9f8af7b44647d5 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 18 Jun 2023 17:41:38 +0200 Subject: Imported and modified evcli's api client code --- internal/provider/project_resource.go | 2 +- internal/provider/projects_data_source.go | 2 +- internal/provider/provider.go | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'internal') diff --git a/internal/provider/project_resource.go b/internal/provider/project_resource.go index 9e9d9e2..541f8b1 100644 --- a/internal/provider/project_resource.go +++ b/internal/provider/project_resource.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "git.adyxax.org/adyxax/terraform-eventline/internal/evcli" + "git.adyxax.org/adyxax/terraform-eventline/external/evcli" "github.com/exograd/eventline/pkg/eventline" "github.com/exograd/go-daemon/ksuid" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/provider/projects_data_source.go b/internal/provider/projects_data_source.go index e0b5b8b..8ae8862 100644 --- a/internal/provider/projects_data_source.go +++ b/internal/provider/projects_data_source.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "git.adyxax.org/adyxax/terraform-eventline/internal/evcli" + "git.adyxax.org/adyxax/terraform-eventline/external/evcli" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 3ae769e..635580f 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "git.adyxax.org/adyxax/terraform-eventline/internal/evcli" + "git.adyxax.org/adyxax/terraform-eventline/external/evcli" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" @@ -57,13 +57,12 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, if resp.Diagnostics.HasError() { return } - config := evcli.Config{API: evcli.APIConfig{Endpoint: data.Endpoint.ValueString()}} + config := evcli.APIConfig{Endpoint: data.Endpoint.ValueString(), Key: data.ApiKey.ValueString()} client, err := evcli.NewClient(&config) if err != nil { resp.Diagnostics.AddError("new api client", fmt.Sprintf("Unable to instanciate eventline api client, got error: %s", err)) return } - client.APIKey = data.ApiKey.ValueString() resp.DataSourceData = client resp.ResourceData = client -- cgit v1.2.3