Skip to content

Suppress site connection info password drift - #2265

Open
ksamoray wants to merge 1 commit into
vmware:branch_3122from
ksamoray:cherrypick/branch_3122-2165
Open

Suppress site connection info password drift#2265
ksamoray wants to merge 1 commit into
vmware:branch_3122from
ksamoray:cherrypick/branch_3122-2165

Conversation

@ksamoray

Copy link
Copy Markdown
Contributor

Summary

  • The NSX-T API does not return site node connection passwords in its responses. During read operations, the empty password returned from the API overrides the existing password in the schema, causing Terraform to detect drift and prompt for a perpetual update.
  • Address this by adding the suppressIfEmptyPriorState DiffSuppressFunc to the password field in the connection info schema. This suppresses spurious diffs when the password is empty in the state (such as after an import) while still allowing users to update the password in their configuration.

Test plan

  • go build ./...
  • go vet ./...
  • gofmt -l . (clean)
  • golangci-lint run ./nsxt/ (0 issues)

Note: master's source PR added mock-based regression tests, which this branch has no framework for; the production fix is otherwise a direct, unmodified port.

@ksamoray
ksamoray requested a review from a team August 24, 2026 09:25
@ksamoray
ksamoray force-pushed the cherrypick/branch_3122-2165 branch from edb9baa to aadbe26 Compare September 3, 2026 09:40
The NSX-T API does not return site node connection passwords in its
responses. During read operations, the empty password returned from
the API overrides the existing password in the schema, causing
Terraform to detect drift and prompt for a perpetual update.

Address this by adding the suppressIfEmptyPriorState
DiffSuppressFunc to the password field in the connection info
schema. This suppresses spurious diffs when the password is empty in
the state (such as after an import) while still allowing users to
update the password in their configuration.
@ksamoray
ksamoray force-pushed the cherrypick/branch_3122-2165 branch from aadbe26 to 0f773e4 Compare September 8, 2026 10:56
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.

1 participant