Fix three bugs in nsxt_edge_transport_node_rtep resource - #2244
Open
ksamoray wants to merge 1 commit into
Open
Conversation
4 tasks
Contributor
Author
|
/test-all |
ksamoray
force-pushed
the
b3122/fix/2083-legacy-rtep-bugs
branch
from
September 3, 2026 09:49
63ff74e to
fb9dea8
Compare
Contributor
Author
|
/test-all |
Issue 1 - Import by transport node UUID was broken: Read, Update and
Delete all used d.Get("edge_id") to look up the edge, which is empty
during terraform import (only d.Id() is populated at that point).
Switch all three to d.Id(); add d.Set("edge_id", id) in Read so the
attribute is written back to state after an import.
Issue 2 - Update sent an empty string pointer for NamedTeamingPolicy
whenever the attribute was not set, causing NSX to reject the
request with "uplink teaming policy name/s [] not specified". Apply
the same non-empty guard that Create already had.
Issue 3 - DHCP and no_ipv4 IP assignment types are not supported by
the NSX RTEP API (a DHCP request triggers a server-side NPE, code
99). Add getIPAssignmentSchemaForRTEP() which strips those
unsupported fields from the shared schema, so an unsupported
assignment type is rejected at terraform plan time instead of
reaching the API. Update docs accordingly.
Note: getIPAssignmentSchemaForRTEP() calls getIPAssignmentSchema(false)
(Optional), matching this branch's field as Optional rather than the
Required it currently is. A separate, already-planned fix (PR vmware#1966
upstream) adds Computed:true to getIPAssignmentSchema, and
Required+Computed is an invalid schema combination, so upstream had
already flipped this same field to Optional before this fix landed.
ksamoray
force-pushed
the
b3122/fix/2083-legacy-rtep-bugs
branch
from
September 8, 2026 10:51
fb9dea8 to
3174118
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
d.Get("edge_id")to look up the edge, which is empty during terraform import (onlyd.Id()is populated at that point). Switch all three tod.Id(); addd.Set("edge_id", id)in Read so the attribute is written back to state after an import.NamedTeamingPolicywhenever the attribute was not set, causing NSX to reject the request with "uplink teaming policy name/s [] not specified". Apply the same non-empty guard that Create already had.no_ipv4IP assignment types are not supported by the NSX RTEP API (a DHCP request triggers a server-side NPE, code 99). AddgetIPAssignmentSchemaForRTEP()which strips those unsupported fields from the shared schema, so an unsupported assignment type is rejected at terraform plan time instead of reaching the API. Update docs accordingly.Dependency note:
getIPAssignmentSchemaForRTEP()callsgetIPAssignmentSchema(false)(Optional), flipping this branch'sip_assignmentfield from its currentRequiredtoOptional. This isn't a regression introduced here — a separate, already-queued fix (upstream PR #1966, "Fixing the resource diff issue") addsComputed: truetogetIPAssignmentSchema, andRequired+Computedis an invalid schema combination, so upstream had already flipped this same field toOptionalbefore this fix landed. When #1966 is ported to this branch, its hunk touching this specific line will be a no-op (already handled here); #1966'sComputed: trueaddition togetIPAssignmentSchemaitself is unaffected and still needs to land separately.Test plan
go build ./...go vet ./...gofmt -l .(clean)golangci-lint run ./nsxt/(0 issues)terrafmt diff ./docs --pattern '*.md'(clean)markdownlint-cli2 docs/**/*.md(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 aside from the noted schema-signature simplification.