Skip to content

Fix host state drift in nsxt_proxy_config - #2281

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

Fix host state drift in nsxt_proxy_config#2281
ksamoray wants to merge 1 commit into
vmware:branch_3122from
ksamoray:cherrypick/branch_3122-2211

Conversation

@ksamoray

Copy link
Copy Markdown
Contributor

Summary

  • When enabled is set to false and host is omitted from the HCL configuration, the provider sets a default host placeholder (proxy.example.com) to satisfy NSX Manager API requirements.
  • Because host was defined as Optional: true without Computed: true, Terraform detected perpetual state drift on plan / apply when reading back the provider-assigned default value.
  • Mark host as Computed: true in the schema so Terraform treats the injected default value as expected, eliminating drift.

Found during a follow-up pass — this PR was missed by the original commit-by-commit audit of master's bug fixes; not part of any previously-excluded cluster.

Test plan

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

Direct, unmodified port — no test files touched in the source PR.

@ksamoray
ksamoray requested a review from a team August 25, 2026 08:50
@ksamoray
ksamoray force-pushed the cherrypick/branch_3122-2211 branch from fbce9e1 to 9931e21 Compare September 3, 2026 09:40
When enabled is set to false and host is omitted from the HCL
configuration, the provider sets a default host placeholder
('proxy.example.com') to satisfy NSX Manager API requirements.

Because host was defined as Optional: true without Computed: true,
Terraform detected perpetual state drift on plan / apply when
reading back the provider-assigned default value.

Mark host as Computed: true in the schema so Terraform treats the
injected default value as expected, eliminating drift.
@ksamoray
ksamoray force-pushed the cherrypick/branch_3122-2211 branch from 9931e21 to bec1e2f Compare September 8, 2026 10:57
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