Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On read, extract sensitive data from state #997

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

ksamoray
Copy link
Collaborator

@ksamoray ksamoray commented Oct 10, 2023

NSX does not return sensitive data (e.g passwords) on GET operation, and therefore TF detects a diff.
But as the schema.Resource object contains the credentials from the state, we can keep these intact and then the value will remain as is and stored again in the state.
This is relevant to the transport_node resource as it contains multiple password attributes, which are as of now placed in empty maps during read - hence state values are ignored.

@ksamoray ksamoray requested a review from annakhm October 10, 2023 08:00
case model.EdgeNode__TYPE_IDENTIFIER:
elems := d.Get("edge_node").([]interface{})
elem = elems[0].(map[string]interface{})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be present (and crush) with import command

@ksamoray ksamoray force-pushed the xport_node_sensitive_data branch 3 times, most recently from 17a9921 to 173db5e Compare October 12, 2023 08:32
NSX does not return sensitive data (e.g passwords) on GET operation, and
therefore TF detects a diff.
But as the schema.Resource object contains the credentials from the
state, we can keep these intact and then the value will remain as is and
stored again in the state.

Signed-off-by: Kobi Samoray <[email protected]>
@ksamoray ksamoray force-pushed the xport_node_sensitive_data branch from 173db5e to e777aa7 Compare October 13, 2023 16:30
@ksamoray ksamoray merged commit c92f82e into vmware:master Oct 13, 2023
2 checks passed
@ksamoray ksamoray deleted the xport_node_sensitive_data branch October 13, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants