Skip to content

Commit

Permalink
fix: send null namespace for bindings instead of empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Jul 1, 2024
1 parent 70755a5 commit 27e7af9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/resource_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func TestAccBinding(t *testing.T) {
resource.TestCheckResourceAttr(
"kestra_binding.new", "role_id", "admin",
),
resource.TestCheckNoResourceAttr(
"kestra_binding.new", "namespace",
),
),
},
{
Expand Down
5 changes: 4 additions & 1 deletion internal/provider/utils_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 27e7af9

Please sign in to comment.