Skip to content

Commit

Permalink
Fix bug with flattening non-FerretDB DBaaS replicas (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
christhemorse committed Nov 8, 2023
1 parent 7709f57 commit 470df18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vultr/data_source_vultr_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ func flattenReplicas(db *govultr.Database) []map[string]interface{} {
"label": db.ReadReplicas[v].Label,
"tag": db.ReadReplicas[v].Tag,
"dbname": db.ReadReplicas[v].DBName,
"ferretdb_credentials": flattenFerretDBCredentials(&db.ReadReplicas[v]),
"host": db.ReadReplicas[v].Host,
"public_host": db.ReadReplicas[v].PublicHost,
"user": db.ReadReplicas[v].User,
Expand All @@ -381,8 +380,8 @@ func flattenReplicas(db *govultr.Database) []map[string]interface{} {
"cluster_time_zone": db.ReadReplicas[v].ClusterTimeZone,
}

if db.DatabaseEngine != "ferretpg" {
delete(r, "ferretdb_credentials")
if db.DatabaseEngine == "ferretpg" {
r["ferretdb_credentials"] = flattenFerretDBCredentials(&db.ReadReplicas[v])
}

if db.PublicHost == "" {
Expand Down

0 comments on commit 470df18

Please sign in to comment.