fix: remove identity from postgres-flex
[skip ci]
This commit is contained in:
parent
c1f463935b
commit
ba579760d5
20 changed files with 570 additions and 581 deletions
|
|
@ -65,15 +65,19 @@ func mapResourceFields(source *v3alpha1api.GetDatabaseResponse, model *resourceM
|
|||
}
|
||||
|
||||
var databaseId int64
|
||||
if model.Id.ValueInt64() != 0 {
|
||||
databaseId = model.Id.ValueInt64()
|
||||
if model.DatabaseId.ValueInt64() != 0 {
|
||||
if source.Id != 0 {
|
||||
if model.DatabaseId.ValueInt64() != int64(source.Id) {
|
||||
return fmt.Errorf("retrieved ID does not match known ID")
|
||||
}
|
||||
}
|
||||
databaseId = model.DatabaseId.ValueInt64()
|
||||
} else if source.Id != 0 {
|
||||
databaseId = int64(source.Id)
|
||||
} else {
|
||||
return fmt.Errorf("database id not present")
|
||||
}
|
||||
|
||||
model.Id = types.Int64Value(databaseId)
|
||||
model.DatabaseId = types.Int64Value(databaseId)
|
||||
model.Name = types.StringValue(source.GetName())
|
||||
model.Owner = types.StringValue(cleanString(source.Owner))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue