Complete the low-risk half of the Sentry -> Cairn OBS rebrand
Sweeps the references that carry no runtime coupling, and fixes one that
turned out to be a real bug rather than stale branding.
Docker network: sentry_default -> cairnobs_default across 23 runbook and
test-header `docker run` commands. Compose derives the network from the
directory name, so this lands together with renaming the working copy to
cairnobs/ -- the two are only correct as one change.
Stale references corrected: four Dockerfile "repo root (sentry/)"
headers; .env pointing at the long-renamed deploy/helm/sentry/ chart;
five Helm comments describing the topic as sentry.logs.raw when all four
code paths have defaulted to cairnobs.logs.raw for some time; an
absolute /home/john/Projects/sentry/ path in the operator's package doc,
now repo-relative; the hand-written Tenant CRD description in both of
its identical copies, whose Go source already said Cairn OBS.
Migration 0043 repoints the default tenant's data source. 0026 seeded it
with ('sentry', '/var/lib/sentry-search') to match what
api/internal/config then defaulted to; the rebrand later moved those
defaults to "cairnobs" and /var/lib/cairnobs-search without moving the
already-applied row, leaving the default tenant naming a ClickHouse
database nothing writes to. Scoped to the exact stale values so it is a
no-op on any deployment that set them deliberately. 0026's comment is
annotated as superseded; its applied SQL is untouched.
Deliberately not included: the gRPC wire packages (sentry.logs.v1,
sentry.agent.v1) and proto/sentry/ import paths, which cannot change
without a lockstep agent/server upgrade; the Helm chart's
sentry_metadata database and sentry role, which need a real Postgres
migration on existing deployments; and the compliance audit records in
docs/compliance/, which are a dated historical record.
go build, go vet, and go test pass for ingest and deploy/operator.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# default: "single-tenant" (api, Phase 0-3 behavior) or "enterprise"
|
||||
# (enterprise-api, Phase 4 multi-tenant) -- mutually exclusive, the same
|
||||
# choice Helm's enterprise.enabled flag makes for a real cluster
|
||||
# (deploy/helm/sentry/templates/api.yaml vs enterprise-api.yaml). See
|
||||
# (deploy/helm/cairnobs/templates/api.yaml vs enterprise-api.yaml). See
|
||||
# the api/enterprise-api service definitions in docker-compose.yml.
|
||||
#
|
||||
# Override per-invocation without editing this file:
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Build context must be the repo root (sentry/), not agent/, since this
|
||||
# Build context must be the repo root (cairnobs/), not agent/, since this
|
||||
# needs both agent/ and proto/:
|
||||
# docker build -f agent/Dockerfile -t cairnobs-agent .
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
// Skipped unless SESSIONCHECK_TEST_POSTGRES_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/alerting \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/alerting \
|
||||
// -e SESSIONCHECK_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
// -e SESSIONCHECK_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./internal/sessioncheck/... -run Integration -v
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Build context must be the repo root (sentry/), since this needs both
|
||||
# Build context must be the repo root (cairnobs/), since this needs both
|
||||
# api/ and proto/ (api now speaks gRPC to /search, using proto's checked-in
|
||||
# Go bindings via the `replace` directive in api/go.mod):
|
||||
# docker build -f api/Dockerfile -t cairnobs-api .
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//
|
||||
// Skipped unless DASHBOARDS_TEST_POSTGRES_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/api \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/api \
|
||||
// -e DASHBOARDS_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
// -e DASHBOARDS_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./dashboards/... -run Integration -v
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//
|
||||
// Skipped unless LOCALAUTH_TEST_POSTGRES_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/api \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/api \
|
||||
// -e LOCALAUTH_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
// -e LOCALAUTH_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./localauth/... -run Integration -v
|
||||
|
||||
@@ -33,7 +33,7 @@ spec:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
description: >-
|
||||
Tenant is the K8s-native representation of one Sentry tenant's
|
||||
Tenant is the K8s-native representation of one Cairn OBS tenant's
|
||||
deployment-topology state -- see
|
||||
deploy/operator/internal/controller/tenant_controller.go's doc
|
||||
comment for what the controller does and does not manage.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{/*
|
||||
Only rendered once per-tenant write-routing is actually turned on (see
|
||||
ingest.yaml's -mode=server comment) -- this Deployment is what takes
|
||||
over consuming sentry.logs.raw once ingest.yaml's own consumer half
|
||||
over consuming cairnobs.logs.raw once ingest.yaml's own consumer half
|
||||
stops, routing each record to its own tenant's dedicated ClickHouse
|
||||
database (enterprise/internal/chwriter) instead of the one shared table.
|
||||
No Service: this is a pure background worker, nothing calls it, only
|
||||
|
||||
@@ -26,7 +26,7 @@ spec:
|
||||
# -mode=server only: this Deployment stops running the
|
||||
# ClickHouse-writing consumer half (the default -mode=all)
|
||||
# once per-tenant write-routing is on -- enterprise-ingest.yaml
|
||||
# (below) takes over consuming sentry.logs.raw instead, so it
|
||||
# (below) takes over consuming cairnobs.logs.raw instead, so it
|
||||
# can write each tenant's records to their own database rather
|
||||
# than the one shared table ingest's own consumer always
|
||||
# writes to. The agent-facing server half (PushBatch, tenant
|
||||
|
||||
@@ -72,7 +72,7 @@ spec:
|
||||
- name: admin
|
||||
port: 9644
|
||||
---
|
||||
# One-shot: creates the sentry.logs.raw topic. Same image
|
||||
# One-shot: creates the cairnobs.logs.raw topic. Same image
|
||||
# transport/Dockerfile builds for docker-compose.yml's redpanda-provision
|
||||
# service. Deliberately a plain Job, not a Helm hook -- see
|
||||
# deploy/helm/cairnobs/README.md's "Startup ordering" section for why
|
||||
|
||||
@@ -79,7 +79,7 @@ ingest:
|
||||
# -create-ingest-credential-tenant=<id>`) or be refused outright. Also
|
||||
# controls per-tenant write-routing: true switches ingest.yaml's
|
||||
# Deployment to -mode=server only and renders enterprise-ingest.yaml
|
||||
# to take over consuming sentry.logs.raw, writing each tenant's
|
||||
# to take over consuming cairnobs.logs.raw, writing each tenant's
|
||||
# records into their own ClickHouse database instead of the one
|
||||
# shared table -- both flags gate together since write-routing is only
|
||||
# meaningful once records actually carry a tenant_id to route on.
|
||||
@@ -164,7 +164,7 @@ enterprise:
|
||||
tag: latest
|
||||
# enterprise-ingest (templates/enterprise-ingest.yaml) -- only
|
||||
# rendered when ingest.requireTenantCredential is also true (see that
|
||||
# value's comment); takes over consuming sentry.logs.raw from
|
||||
# value's comment); takes over consuming cairnobs.logs.raw from
|
||||
# ingest.yaml's own consumer once per-tenant write-routing is on. Same
|
||||
# "repo root build context" reasoning as apiImage above -- see
|
||||
# enterprise/cmd/enterprise-ingest/Dockerfile.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Package v1alpha1 contains the Tenant API's Go types -- kubebuilder's
|
||||
// standard api/<version>/ layout, hand-written rather than scaffolded
|
||||
// (no kubebuilder/controller-gen binary available in this environment;
|
||||
// see /home/john/Projects/sentry/deploy/README.md's verification
|
||||
// see /deploy/README.md's verification
|
||||
// section for what that means for this package specifically: it's real,
|
||||
// compiling, unit-tested Go code, never reconciled against a live
|
||||
// cluster).
|
||||
|
||||
@@ -33,7 +33,7 @@ spec:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
description: >-
|
||||
Tenant is the K8s-native representation of one Sentry tenant's
|
||||
Tenant is the K8s-native representation of one Cairn OBS tenant's
|
||||
deployment-topology state -- see
|
||||
deploy/operator/internal/controller/tenant_controller.go's doc
|
||||
comment for what the controller does and does not manage.
|
||||
|
||||
@@ -95,7 +95,7 @@ Bring up a local webhook receiver for testing (no real Slack/PagerDuty
|
||||
needed):
|
||||
|
||||
```sh
|
||||
docker run -d --name cairnobs-webhook-sink --network sentry_default \
|
||||
docker run -d --name cairnobs-webhook-sink --network cairnobs_default \
|
||||
-p 9099:9099 -v $(pwd)/hack/webhook-sink:/src -w /src golang:1.25-alpine go run .
|
||||
```
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ This is the fix from Phase 4 task 7/8 (see `/docs/security/threat-model.md`)
|
||||
tenant. Verify the real SQL, not just the fake-store unit tests:
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd)/api:/src -w /src \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/api:/src -w /src \
|
||||
-e DASHBOARDS_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e DASHBOARDS_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./dashboards/... -run Integration -v
|
||||
@@ -373,7 +373,7 @@ PermissionStore`) have real integration tests, same skip-gated shape as
|
||||
§6 below:
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \
|
||||
-e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/rbacstore/... -run DashboardPermission -v
|
||||
@@ -394,12 +394,12 @@ when `enterprise-api` (not plain `api`) is serving traffic -- see
|
||||
## 6. `enterprise/internal/rbacstore` and `internal/audit` (already verified — reconfirm here)
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \
|
||||
-e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/rbacstore/... -v
|
||||
|
||||
docker run --rm --network sentry_default -v $(pwd):/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd):/src -w /src/enterprise \
|
||||
-e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \
|
||||
-e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \
|
||||
@@ -536,12 +536,12 @@ as an integration test instead of a curl walkthrough since a full login
|
||||
walkthrough isn't scripted yet):
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd)/enterprise:/src -w /src \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/enterprise:/src -w /src \
|
||||
-e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
-e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/chrunner/... -v
|
||||
|
||||
docker run --rm --network sentry_default -v $(pwd)/enterprise:/src -w /src \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/enterprise:/src -w /src \
|
||||
-e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
-e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/tenantprovision/... -v
|
||||
|
||||
@@ -74,7 +74,7 @@ Run it as a container on the compose network with a network alias of
|
||||
`OLLAMA_BASE_URL` at it via a throwaway compose override:
|
||||
|
||||
```sh
|
||||
docker run -d --rm --name cairnobs-mock-ollama --network sentry_default --network-alias ollama \
|
||||
docker run -d --rm --name cairnobs-mock-ollama --network cairnobs_default --network-alias ollama \
|
||||
-v "$(pwd)/hack/mock-ollama:/src" -w /src golang:1.25-alpine \
|
||||
sh -c "go build -o /tmp/mock-ollama . && /tmp/mock-ollama"
|
||||
|
||||
@@ -188,7 +188,7 @@ cd api && go build ./... && go vet ./... && go test ./...
|
||||
cd enterprise && go build ./... && go vet ./... && go test ./...
|
||||
|
||||
# live-Postgres audit tests specifically, against the real dev stack:
|
||||
docker run --rm --network sentry_default -v "$(pwd):/src" -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v "$(pwd):/src" -w /src/enterprise \
|
||||
-e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \
|
||||
-e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \
|
||||
|
||||
@@ -369,7 +369,7 @@ integration tests are skipped by default and only run with
|
||||
`AUDIT_TEST_POSTGRES_ADDR` set:
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
-e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \
|
||||
-e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \
|
||||
@@ -380,7 +380,7 @@ docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
constraints), skipped unless `RBACSTORE_TEST_POSTGRES_ADDR` is set:
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
-e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
-e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/rbacstore/... -v
|
||||
@@ -392,12 +392,12 @@ since `internal/chrunner` imports `api/authz`/`api/querylang/executor`
|
||||
via `go.mod`'s `replace` directives to `../api`):
|
||||
|
||||
```sh
|
||||
docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
-e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
-e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/tenantprovision/... -v
|
||||
|
||||
docker run --rm --network sentry_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
docker run --rm --network cairnobs_default -v $(pwd)/..:/src -w /src/enterprise \
|
||||
-e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
-e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
golang:1.25-alpine go test ./internal/chrunner/... -v
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// mocked pgxpool can't actually exercise. Skipped unless
|
||||
// AUDIT_TEST_POSTGRES_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// -e AUDIT_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
// -e AUDIT_TEST_POSTGRES_PASSWORD=audit-writer-dev-only \
|
||||
// -e AUDIT_TEST_ADMIN_PASSWORD=cairnobs-dev-only \
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//
|
||||
// Skipped unless CHRUNNER_TEST_CLICKHOUSE_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// -e CHRUNNER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
// -e CHRUNNER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./internal/chrunner/... -v
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// convention as enterprise/internal/chrunner's own tests), skipped
|
||||
// unless that's set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// -e CHWRITER_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
// -e CHWRITER_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./internal/chwriter/... -v
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// wouldn't actually exercise it. Skipped unless RBACSTORE_TEST_POSTGRES_ADDR
|
||||
// is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// -e RBACSTORE_TEST_POSTGRES_ADDR=metadata-postgres:5432 \
|
||||
// -e RBACSTORE_TEST_POSTGRES_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./internal/rbacstore/... -v
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// driver.Conn can't meaningfully verify. Skipped unless
|
||||
// TENANTPROVISION_TEST_CLICKHOUSE_ADDR is set; run via:
|
||||
//
|
||||
// docker run --rm --network sentry_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// docker run --rm --network cairnobs_default -v $(pwd)/../../..:/src -w /src/enterprise \
|
||||
// -e TENANTPROVISION_TEST_CLICKHOUSE_ADDR=clickhouse:9000 \
|
||||
// -e TENANTPROVISION_TEST_CLICKHOUSE_PASSWORD=cairnobs-dev-only \
|
||||
// golang:1.25-alpine go test ./internal/tenantprovision/... -v
|
||||
|
||||
@@ -14,7 +14,7 @@ go run . --count 500000
|
||||
|
||||
# 2. Run a webhook-sink so the (never-firing, by design) rules have a
|
||||
# valid notification target to point at:
|
||||
docker run -d --name cairnobs-webhook-sink --network sentry_default \
|
||||
docker run -d --name cairnobs-webhook-sink --network cairnobs_default \
|
||||
-p 9099:9099 -v $(pwd)/../webhook-sink:/src -w /src golang:1.25-alpine go run .
|
||||
|
||||
# 3. Run the load test:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// same reason: no live model, deterministic output, fast.
|
||||
//
|
||||
// Not part of any docker-compose service by default -- run it
|
||||
// standalone (or as a throwaway container on the sentry_default
|
||||
// standalone (or as a throwaway container on the cairnobs_default
|
||||
// network) and point OLLAMA_BASE_URL at it. See
|
||||
// /docs/phase-7-runbook.md for the exact recipe.
|
||||
package main
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Build context must be the repo root (sentry/), not ingest/, since this
|
||||
# Build context must be the repo root (cairnobs/), not ingest/, since this
|
||||
# needs both ingest/ and proto/:
|
||||
# docker build -f ingest/Dockerfile -t cairnobs-ingest .
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Command ingest is the Sentry ingest service. It has two halves that can
|
||||
// Command ingest is the Cairn OBS ingest service. It has two halves that can
|
||||
// run in one process or be split across deployments via --mode:
|
||||
//
|
||||
// - server: mTLS gRPC front end that agents push batches to; forwards
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
-- The 'default' tenant's single data source, pointing at the one
|
||||
-- ClickHouse database ("sentry") and Tantivy index every Phase 0-3
|
||||
-- deployment already uses -- see api/internal/config's CLICKHOUSE_DATABASE
|
||||
-- default and search's index path default.
|
||||
-- deployment already used at the time this was written -- then matching
|
||||
-- api/internal/config's CLICKHOUSE_DATABASE default and search's index
|
||||
-- path default.
|
||||
--
|
||||
-- SUPERSEDED: the Sentry -> Cairn OBS rebrand moved both of those
|
||||
-- defaults ("cairnobs" and /var/lib/cairnobs-search) without updating
|
||||
-- this already-applied seed. 0043 repoints the row. The SQL below is
|
||||
-- left exactly as applied -- do not edit it; fix forward instead.
|
||||
INSERT INTO data_sources (id, tenant_id, name, clickhouse_database_name, tantivy_index_path)
|
||||
SELECT '00000000-0000-0000-0000-000000000001', 'default', 'default', 'sentry', '/var/lib/sentry-search'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM data_sources WHERE tenant_id = 'default')
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
-- Repoint the 'default' tenant's data source at the post-rebrand
|
||||
-- ClickHouse database and Tantivy index path.
|
||||
--
|
||||
-- 0026 seeded this row with ('sentry', '/var/lib/sentry-search'),
|
||||
-- correct at the time: it deliberately mirrored what api/internal/config
|
||||
-- then defaulted CLICKHOUSE_DATABASE to, and search's index path
|
||||
-- default. The Sentry -> Cairn OBS rebrand later moved both defaults --
|
||||
-- api/internal/config and ingest/internal/config now default to
|
||||
-- "cairnobs", and every index path in the tree is
|
||||
-- /var/lib/cairnobs-search (docker-compose's search-index-data mount,
|
||||
-- the Helm chart's search.yaml, and the per-tenant paths
|
||||
-- enterprise/cmd/enterprise-api builds) -- but the already-applied
|
||||
-- 0026 row did not move with them.
|
||||
--
|
||||
-- The result on any database where 0026 ran: the default tenant's data
|
||||
-- source names a ClickHouse database nothing writes to, and an index
|
||||
-- path nothing maintains. Editing 0026 in place would not fix those
|
||||
-- deployments, since it has already been recorded as applied -- hence a
|
||||
-- forward migration.
|
||||
--
|
||||
-- Scoped by the exact stale values rather than by tenant_id alone, so
|
||||
-- this is a no-op on:
|
||||
-- - fresh databases, where 0026's seed already reflects current
|
||||
-- defaults if it is ever re-run,
|
||||
-- - deployments that set CLICKHOUSE_DATABASE explicitly and corrected
|
||||
-- this row by hand.
|
||||
-- It will not clobber a deliberately-chosen database name.
|
||||
UPDATE data_sources
|
||||
SET clickhouse_database_name = 'cairnobs'
|
||||
WHERE tenant_id = 'default'
|
||||
AND name = 'default'
|
||||
AND clickhouse_database_name = 'sentry';
|
||||
|
||||
UPDATE data_sources
|
||||
SET tantivy_index_path = '/var/lib/cairnobs-search'
|
||||
WHERE tenant_id = 'default'
|
||||
AND name = 'default'
|
||||
AND tantivy_index_path = '/var/lib/sentry-search';
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Build context must be the repo root (sentry/), since this needs both
|
||||
# Build context must be the repo root (cairnobs/), since this needs both
|
||||
# search/ and proto/:
|
||||
# docker build -f search/Dockerfile -t cairnobs-search .
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user