@@ -350,8 +350,6 @@ func openShiftPlatformSchema() schema.Attribute {
350350 }
351351}
352352
353- // TODO review done until here
354-
355353func aksReplicationConfigSchema () schema.Attribute {
356354 return schema.SingleNestedAttribute {
357355 MarkdownDescription : "Replication configuration for AKS (optional, but required for replication)" ,
@@ -812,8 +810,6 @@ func azureReplicationConfigSchema() schema.Attribute {
812810 }
813811}
814812
815- // TODO continue here.
816-
817813func azureRgReplicationConfigSchema () schema.Attribute {
818814 return schema.SingleNestedAttribute {
819815 MarkdownDescription : "Azure Resource Group-specific replication configuration for the platform." ,
@@ -1155,6 +1151,8 @@ func (r *platformResource) Create(ctx context.Context, req resource.CreateReques
11551151 return
11561152 }
11571153
1154+ handleObfuscatedSecrets (& createdPlatform .Spec .Config , & platform .Spec .Config , resp .Diagnostics )
1155+
11581156 resp .Diagnostics .Append (resp .State .Set (ctx , createdPlatform )... )
11591157}
11601158
@@ -1163,7 +1161,7 @@ func (r *platformResource) Read(ctx context.Context, req resource.ReadRequest, r
11631161 var uuid string
11641162 resp .Diagnostics .Append (req .State .GetAttribute (ctx , path .Root ("metadata" ).AtName ("uuid" ), & uuid )... )
11651163
1166- platform , err := r .client .ReadPlatform (uuid )
1164+ readPlatform , err := r .client .ReadPlatform (uuid )
11671165 if err != nil {
11681166 resp .Diagnostics .AddError (
11691167 fmt .Sprintf ("Could not read platform with UUID '%s'" , uuid ),
@@ -1172,14 +1170,17 @@ func (r *platformResource) Read(ctx context.Context, req resource.ReadRequest, r
11721170 return
11731171 }
11741172
1175- if platform == nil {
1173+ if readPlatform == nil {
11761174 // The platform was deleted outside of Terraform, so we remove it from the state
11771175 resp .State .RemoveResource (ctx )
11781176 return
11791177 }
11801178
1181- // client data maps directly to the schema so we just need to set the state
1182- resp .Diagnostics .Append (resp .State .Set (ctx , platform )... )
1179+ statePlatformSpec := client.MeshPlatformSpec {}
1180+ req .State .GetAttribute (ctx , path .Root ("spec" ), & statePlatformSpec )
1181+ handleObfuscatedSecrets (& readPlatform .Spec .Config , & statePlatformSpec .Config , resp .Diagnostics )
1182+
1183+ resp .Diagnostics .Append (resp .State .Set (ctx , readPlatform )... )
11831184}
11841185
11851186func (r * platformResource ) Update (ctx context.Context , req resource.UpdateRequest , resp * resource.UpdateResponse ) {
@@ -1220,6 +1221,8 @@ func (r *platformResource) Update(ctx context.Context, req resource.UpdateReques
12201221 return
12211222 }
12221223
1224+ handleObfuscatedSecrets (& updatedPlatform .Spec .Config , & platform .Spec .Config , resp .Diagnostics )
1225+
12231226 resp .Diagnostics .Append (resp .State .Set (ctx , updatedPlatform )... )
12241227}
12251228
0 commit comments