Repository navigation
sourcegraph: add golden test for selectors and volume claim templates - #1014
Merged
marcleblanc2 merged 4 commits intoNov 11, 2026
Merged
Conversation
Snapshots of every workload selector, pod labels, volume claim template, and Service and PodDisruptionBudget selector, recorded on 33c9ef8 (before the opt-in selector labels), so a change that would break helm upgrade of an existing release fails the tests. Amp-Thread-ID: https://ampcode.com/threads/T-de6ef54a-e04e-4aeb-9ed5-101ed382c9bf Co-authored-by: Amp <amp@ampcode.com>
A custom selector label that repeats app.kubernetes.io/name or app.kubernetes.io/instance, a podLabels key that repeats a selector label, and indexedSearch.storageLabels.deploy rendered the key twice, and the last value won. Selector labels are now merged into one map, podLabels skip keys the selector labels already set, and a different value fails the render, because it would stop the workload selector from matching its pods. Amp-Thread-ID: https://ampcode.com/threads/T-de6ef54a-e04e-4aeb-9ed5-101ed382c9bf Co-authored-by: Amp <amp@ampcode.com>
Drop sourcegraph.extraPodLabels and its tests. A podLabels key that repeats a selector label renders twice already on main, so fixing it is outside this change; the selector and storage label fixes stay. Amp-Thread-ID: https://ampcode.com/threads/T-de6ef54a-e04e-4aeb-9ed5-101ed382c9bf Co-authored-by: Amp <amp@ampcode.com>
Revert the selector label merge and the indexedSearch.storageLabels.deploy check with their tests. Both only affect custom values that conflict with labels the chart sets, and render consistently with Helm. Keep the golden test. Amp-Thread-ID: https://ampcode.com/threads/T-de6ef54a-e04e-4aeb-9ed5-101ed382c9bf Co-authored-by: Amp <amp@ampcode.com>
2 of 3 tasks
marcleblanc2
approved these changes
Nov 11, 2026
marcleblanc2
pushed a commit
that referenced
this pull request
Nov 13, 2026
…#1014) Follow-up to #1007 from review. #1007 changes the helper behind every selector, and its tests would still pass if a default selector changed, which would break `helm upgrade` of every existing release. This adds a golden test recorded on `33c9ef8`, before #1007, that snapshots every workload selector, pod label set, volume claim template, and Service and PodDisruptionBudget selector. ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md): test-only change - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md): not needed, test only - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes): not needed ### Test plan - The golden test (108 snapshots, with jaeger, syntactic-code-intel, all 10 PDBs, 2 worker replicas, and a `podLabels` case) passes unchanged on #1007. - It fails on mutations that change default selectors or labels, such as the frontend selector losing `app.kubernetes.io/name`/`instance`, which #1007's own tests miss. --------- Co-authored-by: Amp <amp@ampcode.com>
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.
Follow-up to #1007 from review. #1007 changes the helper behind every selector, and its tests would still pass if a default selector changed, which would break
helm upgradeof every existing release. This adds a golden test recorded on33c9ef8, before #1007, that snapshots every workload selector, pod label set, volume claim template, and Service and PodDisruptionBudget selector.Checklist
Test plan
podLabelscase) passes unchanged on Add opt-in selector labels to adopt existing workloads #1007.app.kubernetes.io/name/instance, which Add opt-in selector labels to adopt existing workloads #1007's own tests miss.