Skip to content

Stop VirtualService labels from mutating global.labels - #136

Open
Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9
Open

Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9

Conversation

@phacops

Copy link
Copy Markdown

Summary

virtualservice.yaml called merge .Values.global.labels .Values.virtualService.labels. Sprig merge writes into 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 beat VirtualService labels, the reverse of every other component.

This uses the same merge (deepCopy <component labels>) .Values.global.labels pattern as the rest of the chart, as the AGENTS.md review checklist requires. It also guards a null virtualService.labels with | default dict.

Input matrix

Input Before After
VS enabled, virtualService.labels set, global.labels set VS labels leak onto other resources (26 in a ci/values-google render) VS labels appear only on the VirtualService
Same key in both maps Global wins VirtualService wins, as for other components
virtualService.labels: {} (default) Global labels only Unchanged
virtualService.labels: null / missing (--reuse-values) Test fails on main Treated as {}
VS disabled Not rendered Unchanged

Cloud and image tags don't matter here: the template has no cloud or image logic.

Tests

  • New cases in labels-merge-isolation_test.yaml, which now includes virtualservice.yaml:
    • no leak onto the API Deployment or its pod template
    • no leak onto the Brainstore reader
    • VS precedence on conflicting keys
    • null labels
  • All 4 fail on main and pass here.
  • ./test.sh passes: 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 only app, so they are not affected.


Generated by Claude Code

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T21:52:18.217455Z 7f4b328 PR opened
ℹ️ About Codex in GitHub

Your 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.

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] This PR appears safe to merge.

Summary

Stops VirtualService labels from changing global.labels.

  • VirtualService labels stay on the VirtualService and win shared keys.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants