Skip to content

Commit

Permalink
[Fix] Send only what is required in Update of databricks_credential
Browse files Browse the repository at this point in the history
This is a workaround for a problem in the API spec.

Resolves #4335
  • Loading branch information
alexott committed Dec 24, 2024
1 parent 151ed6d commit 55d3fae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions catalog/resource_credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ func ResourceCredential() common.Resource {
}

updateCredRequest.Owner = ""
// Workaround until backend team fixes API issue
if updateCredRequest.AwsIamRole != nil { // Update API accepts only RoleArn, not the rest of attributes
updateCredRequest.AwsIamRole = &catalog.AwsIamRole{RoleArn: updateCredRequest.AwsIamRole.RoleArn}
}
// End of workaround
_, err = w.Credentials.UpdateCredential(ctx, updateCredRequest)
if err != nil {
if d.HasChange("owner") {
Expand Down

0 comments on commit 55d3fae

Please sign in to comment.