Repository navigation
Stop VirtualService labels from mutating global.labels - #136
Open
Pierre Massat (phacops) wants to merge 1 commit into
Open
Pierre Massat (phacops) wants to merge 1 commit into
Pierre Massat (phacops) wants to merge 1 commit into
Conversation
virtualservice.yaml merged into .Values.global.labels directly. Sprig merge mutates its first argument, and Helm renders virtualservice.yaml before most other templates, so any virtualService.labels leaked onto every later resource that reads global.labels. The merge order also let global labels win over VirtualService labels, the reverse of every other component. Use the same deepCopy pattern as the other templates and add VirtualService cases to the label isolation suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01449dBcsndUJDCqCacbrEvW
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Confidence Score: 5/5
[Medium impact] This PR appears safe to merge. SummaryStops VirtualService labels from changing
No actionable issues found. Tests were inspected but not run during this review. Reviews (1) · Last reviewed commit: "Stop VirtualService labels from mutating..." · Reviewed by Greptile |
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
virtualservice.yamlcalledmerge .Values.global.labels .Values.virtualService.labels. Sprigmergewrites into its first argument, and Helm rendersvirtualservice.yamlbefore most other templates. So anyvirtualService.labelsleaked onto every later resource that readsglobal.labels. The merge order also let global labels beat VirtualService labels, the reverse of every other component.This uses the same
merge (deepCopy <component labels>) .Values.global.labelspattern as the rest of the chart, as the AGENTS.md review checklist requires. It also guards a nullvirtualService.labelswith| default dict.Input matrix
virtualService.labelsset,global.labelssetvirtualService.labels: {}(default)virtualService.labels: null/ missing (--reuse-values)main{}Cloud and image tags don't matter here: the template has no cloud or image logic.
Tests
labels-merge-isolation_test.yaml, which now includesvirtualservice.yaml:mainand pass here../test.shpasses: 679 tests, renders for every cloud, lint.Upgrade note
Labels change only where a user had set
virtualService.labels. Those keys are removed from non-VirtualService resources. Selectors use onlyapp, so they are not affected.Generated by Claude Code