feat(nameref): follow name references inside embedded YAML/JSON #6125
feat(nameref): follow name references inside embedded YAML/JSON #6125isumitsolanki wants to merge 1 commit intokubernetes-sigs:masterfrom
Conversation
…/ path suffix Signed-off-by: Sumit Solanki <sumit.solanki@ibm.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: isumitsolanki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @isumitsolanki. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fixes
Closes #6101
Summary
[One line: what changed and which subsystem.]
Example: Implements structured-data traversal for
nameReferenceso names inside YAML/JSON embedded in scalar fields (e.g.ConfigMap.data) can be updated, aligned with structuredreplacementsbehavior.Related issue
Problem
[What was broken or missing; user-visible symptom.]
For #6101:
nameReferenceonly updated normal manifest fields fromfieldSpecs.ConfigMap.data,Secret.stringData, annotations, etc.).secretGeneratorhash suffixes) did not propagate into nested config such asauth.secretNameinsidedata["config.yaml"].Root cause
[Why the old code could not satisfy the issue.]
For #6101: The nameref filter stopped at the leaf scalar that contained the whole embedded document as one string; there was no parse → navigate → update → serialize path for that content.
Solution
[Bullets: syntax, main code paths, compatibility.]
For #6101:
manifest/path//inner.dot.path— manifest segment uses/; inner segment uses.withSmarterPathSplitterescaping (same idea as structuredreplacements).PathMatcheron inner path → existing namerefset/ map / sequence logic → serialize back.api/internal/structuredscalarfor serialization;replacementscalls into it.roleRef//.//unchanged.Impact
replacements.//in path.|vs|-), similar to structuredreplacements.How to verify