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

Creating ns1_user with security_manage_global_2fa true even if set to false #170

Merged
merged 2 commits into from
Aug 20, 2021

Conversation

ThiagoYU
Copy link
Contributor

Terraform set default value to false, but in some cases p.Security was not initialized, so the struct sent in the request didn't have the p.Security default values, so it was using the API default value, which is true.

Even if setting security_manage_global_2fa = false, because GetOk returns false if the value is equal to Zero-value, how Bool zero value is false, it never sets security_manage_global_2fa = false.
The change forces the p.Security to be initialized if it wasn't and change the permission to true if the parameter is passed.

Copy link
Contributor

@pcatalini pcatalini left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Zach-Johnson Zach-Johnson left a comment

Choose a reason for hiding this comment

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

This looks good to me, tested it locally and it looks to be working. Let's add or modify a test case for this in resource_user_test.go please

Copy link
Collaborator

@Zach-Johnson Zach-Johnson left a comment

Choose a reason for hiding this comment

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

lgtm, nice!

@Zach-Johnson Zach-Johnson merged commit 4227e0e into ns1-terraform:master Aug 20, 2021
@ThiagoYU ThiagoYU deleted the DAITDS-188 branch August 23, 2021 16:04
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.

3 participants