fix(dryrun): resolve Target from label not Config name#448
Open
alexandernorth wants to merge 3 commits into
Open
fix(dryrun): resolve Target from label not Config name#448alexandernorth wants to merge 3 commits into
alexandernorth wants to merge 3 commits into
Conversation
henderiw
approved these changes
May 20, 2026
severindellsperger
approved these changes
May 21, 2026
Contributor
severindellsperger
left a comment
There was a problem hiding this comment.
LGTM. Maybe address my comment.
Contributor
Author
Ok, I adjusted the code to match this |
Contributor
|
LGTM |
b5847bd to
c50847f
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
--dry-run=serveragainst aConfigwhose name differs from its target's name failed with:The dry-run path in
ConfigStoreHandler.prepareConfigAndTargetdiscarded theNamespacedNamereturned byconfig.GetTargetKey(labels)and looked up theTargetusing theConfig's own key instead. The same wrong key was thenpropagated as the
DatastoreNamein theTransactionSetRPC.Non-dry-run applies were unaffected because the API server only persists the
Configand the actual target resolution happens later in the reconcilers,which correctly read
config.sdcio.dev/targetName/targetNamespacefromthe labels.
Changes
targetKeyfor theTargetlookup inprepareConfigAndTarget.key types.NamespacedNameparameter fromRunDryRunTransaction; deriveDatastoreNamefrom the resolved*Targetusing
storebackend.KeyFromNSN(...).String(), matching the convention usedby every other call site (
pkg/reconcilers/rollout/transaction.go,apis/config/target_helpers.go,pkg/reconcilers/targetdatastore/reconciler.go,etc.). The previous
types.NamespacedName.String()("ns/name") did not matchthe format the datastore is registered under ("ns.name").