diff --git a/Makefile b/Makefile index 89d2827..54325aa 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ HOSTNAME=github.com NAMESPACE=arkiaconsulting NAME=schemaregistry BINARY=terraform-provider-${NAME} -VERSION=0.3 +VERSION=0.6 OS_ARCH=linux_amd64 default: install diff --git a/examples/main.tf b/examples/main.tf index fb61cf4..0523631 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -1,17 +1,18 @@ terraform { required_providers { schemaregistry = { - version = "0.3" + version = "0.4" source = "github.com/arkiaconsulting/schemaregistry" } } } provider "schemaregistry" { + schema_registry_url = "http://localhost:8081" } resource "schemaregistry_schema" "user_added" { - subject = "MyTopic-akc.test.userAdded" + subject = "MyTopic-akc.test.userAdded-value" schema = file("./userAdded.avsc") } diff --git a/examples/userAdded.avsc b/examples/userAdded.avsc index 8d7e1ba..26acde0 100644 --- a/examples/userAdded.avsc +++ b/examples/userAdded.avsc @@ -5,7 +5,8 @@ "fields": [ { "name": "firstName", - "type": "string" + "type": "string", + "description": "toto" } ] } \ No newline at end of file diff --git a/schemaregistry/provider.go b/schemaregistry/provider.go index 1560b01..e5fb5ba 100644 --- a/schemaregistry/provider.go +++ b/schemaregistry/provider.go @@ -47,10 +47,13 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{} // Warning or errors can be collected in a slice type var diags diag.Diagnostics - if (url != "") && (username != "") && (password != "") { + if (url != "") { client := srclient.CreateSchemaRegistryClient(url) - client.SetCredentials(username, password) + if (username != "") && (password != "") { + client.SetCredentials(username, password) + } + return client, diags }