Skip to content

Commit

Permalink
[MdProxy] Read secret attribute
Browse files Browse the repository at this point in the history
The NSX API returns the metadata secret and therefore it should
be parsed by the read function.

This change also amends the import test to remove the ignore statement
for the secret attribute.

Signed-off-by: Salvatore Orlando <[email protected]>
  • Loading branch information
salv-orlando committed Apr 8, 2024
1 parent 2396119 commit 304a2fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions nsxt/resource_nsxt_policy_metadata_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func resourceNsxtPolicyMetadataProxyRead(d *schema.ResourceData, m interface{})
d.Set("path", obj.Path)
d.Set("revision", obj.Revision)
d.Set("crypto_protocols", stringList2Interface(obj.CryptoProtocols))
d.Set("secret", obj.Secret)
d.Set("edge_cluster_path", obj.EdgeClusterPath)
d.Set("enable_standby_relocation", obj.EnableStandbyRelocation)
d.Set("preferred_edge_paths", stringList2Interface(obj.PreferredEdgePaths))
Expand Down
7 changes: 3 additions & 4 deletions nsxt/resource_nsxt_policy_metadata_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ func TestAccResourceNsxtPolicyMetadataProxy_importBasic(t *testing.T) {
Config: testAccNsxtPolicyMetadataProxyTemplate(true),
},
{
ResourceName: testResourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"secret"}, // Secret isn't returned by NSX as it's a secret...
ResourceName: testResourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
Expand Down

0 comments on commit 304a2fb

Please sign in to comment.