Skip to content

Commit

Permalink
Fix unnecessary node extensions diff in Terraform plan (#39)
Browse files Browse the repository at this point in the history
* fix: prevent node extensions diff when unmanaged

* fix: prevent unnecessary node extensions diff in terraform plan

* fixed auto_manage mutation issue

* added back database resource sensitive tag
  • Loading branch information
KnockOutEZ authored Nov 12, 2024
1 parent 8e824d4 commit e799ab2
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 215 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (c *Client) UpdateDatabase(ctx context.Context, id strfmt.UUID, body *model
return nil, err
}

return c.GetDatabase(ctx, *resp.Payload.ID)
return c.GetDatabase(ctx, id)
}

func (c *Client) DeleteDatabase(ctx context.Context, id strfmt.UUID) error {
Expand Down
23 changes: 22 additions & 1 deletion client/models/extensions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/swagger/databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ definitions:
$ref: "#/definitions/Backups"
Extensions:
type: object
required:
- auto_manage
properties:
auto_manage:
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions client/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ definitions:
items:
type: string
type: array
required:
- auto_manage
type: object
GoogleCredentials:
properties:
Expand Down
2 changes: 1 addition & 1 deletion internals/provider/database/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (d *databasesDataSource) mapExtensionsToModel(extensions *models.Extensions
"requested": types.ListType{ElemType: types.StringType},
},
map[string]attr.Value{
"auto_manage": types.BoolValue(extensions.AutoManage),
"auto_manage": types.BoolPointerValue(extensions.AutoManage),
"available": d.convertToListValue(extensions.Available),
"requested": d.convertToListValue(extensions.Requested),
},
Expand Down
Loading

0 comments on commit e799ab2

Please sign in to comment.