diff --git a/CHANGELOG.md b/CHANGELOG.md index 873a92e..4716c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.17.1 (July 1, 2024) + +BUG FIXES: +* Don't break provider if the URL contains an ending slash +* Send a null namespace instead of an empty one not to break the whole Binding system + ## 0.17.0 (June 4, 2024) BUG FIXES: diff --git a/internal/provider/resource_binding_test.go b/internal/provider/resource_binding_test.go index 998a54d..e5e81c4 100644 --- a/internal/provider/resource_binding_test.go +++ b/internal/provider/resource_binding_test.go @@ -51,6 +51,9 @@ func TestAccBinding(t *testing.T) { resource.TestCheckResourceAttr( "kestra_binding.new", "role_id", "admin", ), + resource.TestCheckNoResourceAttr( + "kestra_binding.new", "namespace", + ), ), }, { diff --git a/internal/provider/utils_binding.go b/internal/provider/utils_binding.go index 366ecc5..470e781 100644 --- a/internal/provider/utils_binding.go +++ b/internal/provider/utils_binding.go @@ -15,7 +15,10 @@ func bindingSchemaToApi(d *schema.ResourceData) (map[string]interface{}, error) body["type"] = d.Get("type").(string) body["externalId"] = d.Get("external_id").(string) body["roleId"] = d.Get("role_id").(string) - body["namespaceId"] = d.Get("namespace").(string) + namespace, provided := d.GetOk("namespace") + if provided { + body["namespaceId"] = namespace.(string) + } return body, nil }