Skip to content

Add Computed to ip_assignment and cpu_config to fix diff issue - #2245

Open
ksamoray wants to merge 1 commit into
vmware:branch_3122from
ksamoray:b3122/fix/1966-resource-diff-issue
Open

Add Computed to ip_assignment and cpu_config to fix diff issue#2245
ksamoray wants to merge 1 commit into
vmware:branch_3122from
ksamoray:b3122/fix/1966-resource-diff-issue

Conversation

@ksamoray

Copy link
Copy Markdown
Contributor

Summary

  • Sub-config objects were not set into schema in the read operation, causing NSX-populated defaults for the enhanced-networking-stack cpu_config block and for ip_assignment to perpetually plan back to empty on every apply.
  • Mark both TypeList blocks Computed so Terraform accepts the server-populated values when the user has not explicitly set them.

Depends on / sequencing note: the only caller passing getIPAssignmentSchema(true) (nsxt_edge_transport_node_rtep) is fixed separately in #2244, which flips it to Optional via a new getIPAssignmentSchemaForRTEP() wrapper — required, since Required + Computed is an invalid schema combination. This PR deliberately does not touch that line to avoid a merge conflict with #2244 regardless of which merges first; verified no other caller in this codebase (or on master) passes true to getIPAssignmentSchema, so once both PRs are in, no invalid schema combination remains.

Test plan

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

@ksamoray
ksamoray requested a review from a team August 23, 2026 11:03
@ksamoray

ksamoray commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/test-all

@ksamoray
ksamoray force-pushed the b3122/fix/1966-resource-diff-issue branch from d2a5dde to 71b5f10 Compare September 3, 2026 09:48
@ksamoray

ksamoray commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/test-all

Sub-config objects were not set into schema in read operation,
causing NSX-populated defaults for the enhanced-networking-stack
cpu_config block and for ip_assignment to perpetually plan back to
empty on every apply.

Mark both TypeList blocks Computed so Terraform accepts the
server-populated values when the user has not explicitly set them.

Note: this drops the "Required: true" caller (nsxt_edge_transport_node_rtep)
since Required+Computed is an invalid schema combination; that specific
line was already flipped to Optional (via getIPAssignmentSchemaForRTEP)
by the separately-landed edge_transport_node_rtep bug-fix PR, so no
change is needed here for it.
@ksamoray
ksamoray force-pushed the b3122/fix/1966-resource-diff-issue branch from 71b5f10 to c09fb8a Compare September 8, 2026 10:55
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