Repository navigation
codeintel-db: keep the PVC named codeintel-db regardless of codeIntelDB.name - #967
Merged
Merged
Conversation
…DB.name The PVC template applied codeIntelDB.name to the claim, but the StatefulSet always references claimName codeintel-db, so setting a custom name left the pod Pending on a missing claim. Every other component hardcodes its PVC name, and values.yaml documents *.name as not affecting PVCs, so align codeintel-db with that contract. Add a helm-unittest suite asserting that a custom name on each PVC-backed component renames the workload but not its PVC or claimName. Closes #612 Amp-Thread-ID: https://ampcode.com/threads/T-01a15718-a970-736b-af0a-1b453f5ba94a Co-authored-by: Amp <amp@ampcode.com>
michaellzc
approved these changes
Oct 20, 2026
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.
Closes #612
Problem
codeintel-db.PersistentVolumeClaim.yamlnamed the PVC{{ default "codeintel-db" .Values.codeIntelDB.name }}, butcodeintel-db.StatefulSet.yamlalways referencesclaimName: codeintel-db. Setting a customcodeIntelDB.nametherefore produced a PVC the StatefulSet never looked for, and the pod sat inPendingwithpersistentvolumeclaim "codeintel-db" not found.Every other PVC-backed component (blobstore, codeinsights-db, pgsql, prometheus, redis-cache, redis-store) hardcodes both the PVC name and the
claimName, andvalues.yamldocuments every*.nameas "Does not affect service names or PVCs." codeintel-db was the only one that broke that contract.Fix
Hardcode the PVC name to
codeintel-db, matching the StatefulSet and the other six components.Chose this over templating
claimNamefrom.namebecause that would silently rename PVCs onhelm upgradefor anyone with a custom name, leaving their data on an orphaned claim. Hardcoding is safe: no working deployment can have data in a custom-named codeintel-db PVC today, since that pod never scheduled.Edge case noted in the changelog: anyone who worked around this by creating a
codeintel-dbPVC by hand needs to add the Helm ownership label and annotations sohelm upgradecan adopt it.Also answers the second comment on the issue:
cache-<name>-searcher-0style PVCs come fromvolumeClaimTemplates, which Kubernetes names<template>-<statefulset>-<ordinal>, so those picking up the custom name is expected.Checklist
Test plan
charts/sourcegraph/tests/componentNamePVC_test.yaml: sets a customnameon all seven PVC-backed components and asserts the workload is renamed while the PVC name andclaimNamestay fixed. Confirmed the codeintel-db case fails onmainwithout the template change and passes with it.helm unittest charts/sourcegraph: 33 suites, 202 tests, 12 snapshots, all passing.helm lint charts/sourcegraph: clean.helm template sg charts/sourcegraph --set codeIntelDB.name=my-release-codeintel-db: PVC andclaimNameboth rendercodeintel-db, StatefulSet rendersmy-release-codeintel-db../scripts/helm-docs.sh: no README changes.