diff options
author | Julien Dessaux | 2023-06-18 17:41:38 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-06-18 17:43:53 +0200 |
commit | 6844355a928b60ffb1006e6b1d9f8af7b44647d5 (patch) | |
tree | 57355ad7bf98b870cf96ceec2a2eae64b94d3276 /internal | |
parent | Implemented project resource (diff) | |
download | terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.tar.gz terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.tar.bz2 terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.zip |
Imported and modified evcli's api client code
Diffstat (limited to 'internal')
-rw-r--r-- | internal/provider/project_resource.go | 2 | ||||
-rw-r--r-- | internal/provider/projects_data_source.go | 2 | ||||
-rw-r--r-- | internal/provider/provider.go | 5 |
3 files changed, 4 insertions, 5 deletions
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 |