Add Computed to ip_assignment and cpu_config to fix diff issue - #2245
Open
ksamoray wants to merge 1 commit into
Open
Add Computed to ip_assignment and cpu_config to fix diff issue#2245ksamoray wants to merge 1 commit into
ksamoray wants to merge 1 commit into
Conversation
Contributor
Author
|
/test-all |
ksamoray
force-pushed
the
b3122/fix/1966-resource-diff-issue
branch
from
September 3, 2026 09:48
d2a5dde to
71b5f10
Compare
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
force-pushed
the
b3122/fix/1966-resource-diff-issue
branch
from
September 8, 2026 10:55
71b5f10 to
c09fb8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cpu_configblock and forip_assignmentto perpetually plan back to empty on every apply.TypeListblocksComputedso 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 toOptionalvia a newgetIPAssignmentSchemaForRTEP()wrapper — required, sinceRequired+Computedis 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) passestruetogetIPAssignmentSchema, 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)