Repository navigation
Commit 925d458
sourcegraph: Drop redundant PRECISE_CODE_INTEL_UPLOAD_* env (#992)
Follow-up to sourcegraph/deploy-sourcegraph-docker#1461, same cleanup
for the Helm chart.
Four templates still set `PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore`
and `PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000` under
`{{ if .Values.blobstore.enabled }}`: `frontend`, `worker`,
`precise-code-intel-worker`, and `syntactic-code-intel-worker`. A
customer reading the templates could reasonably think both
`PRECISE_CODE_INTEL_UPLOAD_*` and `SOURCEGRAPH_UPLOAD_*` need changing
to move to S3 or GCS. This removes the legacy lines so
`SOURCEGRAPH_UPLOAD_*` in `*.env` is the only object storage
configuration in the chart, matching the `external-object-storage`
examples.
The removed values did nothing:
- They are the built-in defaults: `PRECISE_CODE_INTEL_UPLOAD_BACKEND`
defaults to `blobstore`
([lsifuploadstore/config.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/codeintel/shared/lsifuploadstore/config.go?L31)),
and the endpoint defaults to `http://blobstore:9000` outside the
single-container deployment
([deploy/endpoints.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/conf/deploy/endpoints.go)).
- When the legacy backend is `blobstore`,
[`resolveLegacyCompatStorage`](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/object/sourcegraphobjects/backcompat.go?L20-L44)
uses the shared `SOURCEGRAPH_UPLOAD_*` config and keeps only the legacy
bucket name, so the legacy endpoint was never read.
## Impact on existing deployments
- **Default (bundled blobstore):** no change. The rendered env loses two
variables whose values equal the compiled-in defaults, so pods restart
on upgrade (env changed) but behave identically: bundled blobstore,
`lsif-uploads` bucket.
- **`blobstore.enabled: false` with `SOURCEGRAPH_UPLOAD_*` in `*.env`
(the documented path):** no change at all. The removed block never
rendered for these deployments, so the manifests are byte-identical.
- **`blobstore.enabled: true` with `SOURCEGRAPH_UPLOAD_BACKEND=S3|GCS`
in `*.env`:** no change. Code-intel uploads already went to the shared
bucket under the `lsif-uploads/` prefix via the compat shim, and still
do.
- **`blobstore.enabled: true` with
`PRECISE_CODE_INTEL_UPLOAD_BACKEND=S3|GCS` in `*.env`:** behaviour fix,
one upgrade later. The chart's hardcoded `blobstore` rendered *after*
`*.env`, and Kubernetes takes the last duplicate env name, so these
overrides were silently ignored and uploads went to the bundled
blobstore. On the upgrade to this chart, Helm's three-way merge deletes
every env entry with those names, the `*.env` override included, so the
live Deployments carry neither value and runtime behaviour is unchanged
(the deleted values equal the built-in defaults). On the *next* `helm
upgrade`, even one with no changes, the override is rendered once, takes
effect, and uploads switch to the dedicated bucket the customer
configured. Before that second upgrade, make sure the bucket exists and
is reachable, or move the settings to `SOURCEGRAPH_UPLOAD_*`, or remove
them. Running a second `helm upgrade` straight away makes the switch
happen at a known time. Existing uploads in the bundled blobstore are
not migrated. Verified on a kind cluster by @bobheadxi's agent, see the
comment below.
## Impact on new deployments
None beyond less to read. The `external-object-storage` examples already
disable blobstore and set only `SOURCEGRAPH_UPLOAD_*`.
## Test plan
- `helm lint` and `helm unittest ./charts/sourcegraph` pass (218 tests,
12 snapshots).
- `helm template` of `origin/main` vs this branch with default values:
the only difference is the two variables removed from the three services
that render by default (`syntactic-code-intel-worker` is disabled by
default).
- `helm template --set
frontend.env.PRECISE_CODE_INTEL_UPLOAD_BACKEND.value=S3` on
`origin/main` renders `S3` followed by a second `blobstore` entry; on
this branch it renders `S3` once.
- CI.
---------
Co-authored-by: Amp <amp@ampcode.com>1 parent 4a134a2 commit 925d458
5 files changed
Lines changed: 1 addition & 24 deletions
File tree
- charts/sourcegraph
- templates
- frontend
- precise-code-intel
- syntactic-code-intel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 85 | | |
92 | 86 | | |
93 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 65 | | |
72 | 66 | | |
73 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 66 | | |
73 | 67 | | |
74 | 68 | | |
| |||
0 commit comments