Skip to content

fix: allow unlocking existing security_account resources #500

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

Merged
merged 4 commits into from
Jun 5, 2025

Conversation

acch
Copy link
Contributor

@acch acch commented May 19, 2025

Fixes #499.

When unlocking existing, locked security accounts, Terraform produces the following error:

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ netapp-ontap_security_account.security_account, provider
│ "provider[\"registry.terraform.io/netapp/netapp-ontap\"]" produced an
│ unexpected new value: .locked: was cty.False, but now cty.True.
│ 
│ This is a bug in the provider, which should be reported in the
│ provider's own issue tracker.

This PR changes the internal data type of the locked attribute to bool pointer, to allow for three distinct values:

  • null / undefined (-> omit attribute in REST call)
  • true (-> lock account)
  • false (-> unlock account)

ACC tests pass:

$ TF_ACC=1 go test ./internal/provider/security/security_account_resource_test.go -v
=== RUN   TestAccSecurityAccountResource
--- PASS: TestAccSecurityAccountResource (7.98s)
PASS
ok      command-line-arguments  7.988s

@acch acch force-pushed the 499-security-account-locked branch from f990d5f to 65e343a Compare May 19, 2025 13:56
@acch acch changed the base branch from integration/main to stable-2.2.0 May 19, 2025 14:09
acch added 3 commits May 21, 2025 12:53
…citly setting it to false

Signed-off-by: Achim Christ <achim.christ@sva.de>
Signed-off-by: Achim Christ <achim.christ@sva.de>
Signed-off-by: Achim Christ <achim.christ@sva.de>
@acch acch force-pushed the 499-security-account-locked branch from 65e343a to 6f631cd Compare May 21, 2025 12:56
@suhasbshekar suhasbshekar merged commit 97985f7 into NetApp:stable-2.2.0 Jun 5, 2025
7 of 8 checks passed
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.

[Bug]: unable to unlock existing security_account resource
3 participants