Fix drift and update failures for adopted edge transport nodes - #2241
Open
ksamoray wants to merge 1 commit into
Open
Fix drift and update failures for adopted edge transport nodes#2241ksamoray wants to merge 1 commit into
ksamoray wants to merge 1 commit into
Conversation
Contributor
Author
|
/test-all |
ksamoray
force-pushed
the
b3122/fix/2198-adopted-etn-drift
branch
from
September 3, 2026 09:49
bda3c74 to
9bd2604
Compare
node_id-adoption ConflictsWith advanced_configuration, credentials, form_factor and management_interface, so config for an adopted node never sets them. Read still populated all of them unconditionally from the API, showing permanent spurious drift on every plan; form_factor additionally carries a static schema Default that would keep re-asserting itself even with Read fixed, so it needs a DiffSuppressFunc instead. More seriously, Update always rebuilt the request body from config via policyEdgeTransportNodePatch, same as a freshly created node. For an adopted node that sends an empty management_interface, which NSX rejects as missing required fields on any update - including one only triggered by the spurious drift above. Route Update through the same GET-then-merge policyEdgeTransportNodePredeployedPatch that Create already uses for adoption.
ksamoray
force-pushed
the
b3122/fix/2198-adopted-etn-drift
branch
from
September 8, 2026 10:49
9bd2604 to
160a048
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
node_id-adoptionConflictsWithadvanced_configuration,credentials,form_factorandmanagement_interface, so config for an adopted node never sets them.Readstill populated all of them unconditionally from the API, showing permanent spurious drift on every plan;form_factoradditionally carries a static schemaDefaultthat would keep re-asserting itself even withReadfixed, so it needs aDiffSuppressFuncinstead.Updatealways rebuilt the request body from config viapolicyEdgeTransportNodePatch, same as a freshly created node. For an adopted node that sends an emptymanagement_interface, which NSX rejects as missing required fields on any update — including one only triggered by the spurious drift above. RouteUpdatethrough the same GET-then-mergepolicyEdgeTransportNodePredeployedPatchthatCreatealready uses for adoption.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 (no
utgomock_*infrastructure here); the production fix is otherwise a direct, unmodified port.