From 5807e2ba2f89133355c2e9c41e23b7d39e479535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Palet?= Date: Thu, 1 Aug 2024 11:24:23 +0100 Subject: [PATCH] Fix inconsistent result after apply in PostgreSQL Flex database (#488) --- stackit/internal/services/postgresflex/database/resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stackit/internal/services/postgresflex/database/resource.go b/stackit/internal/services/postgresflex/database/resource.go index 780c2764..0bc005ca 100644 --- a/stackit/internal/services/postgresflex/database/resource.go +++ b/stackit/internal/services/postgresflex/database/resource.go @@ -348,6 +348,9 @@ func mapFields(databaseResp *postgresflex.InstanceDatabase, model *Model) error if !ok { return fmt.Errorf("owner is not a string") } + // If the field is returned between with quotes, we trim them to prevent an inconsistent result after apply + ownerStr = strings.TrimPrefix(ownerStr, `"`) + ownerStr = strings.TrimSuffix(ownerStr, `"`) model.Owner = types.StringValue(ownerStr) } }