Skip to content

Commit

Permalink
bugfix: skip setting empty tags in request body (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu committed Apr 25, 2024
1 parent 34332a3 commit 3afdfe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v1.13.1

BUG FIXES:
- Fix a bug when upgrading from previous provider `azapi_resource` resource will set `tags` for resources that don't have `tags` in the configuration.
- Fix a bug that `azapi_resource` resource cannot handle tags with unknown values.
- Fix a bug that `null` value can't pass the schema validation.

Expand Down
2 changes: 1 addition & 1 deletion internal/services/azapi_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ func expandBody(body map[string]interface{}, model AzapiResourceModel) diag.Diag
if body["location"] == nil && !model.Location.IsNull() && !model.Location.IsUnknown() {
body["location"] = model.Location.ValueString()
}
if body["tags"] == nil && !model.Tags.IsNull() && !model.Tags.IsUnknown() {
if body["tags"] == nil && !model.Tags.IsNull() && !model.Tags.IsUnknown() && len(model.Tags.Elements()) != 0 {
body["tags"] = tags.ExpandTags(model.Tags)
}
if body["identity"] == nil && !model.Identity.IsNull() && !model.Identity.IsUnknown() {
Expand Down

0 comments on commit 3afdfe2

Please sign in to comment.