Uh oh!
There was an error while loading. Please reload this page.
fix(cli): discover ingestor SA from ingestionAuthz ConfigMap; drop --ingestor-sa (#7) - #176
Conversation
… drop --ingestor-sa (#7) The ingestor ServiceAccount name was hardcoded to "ingestor" in DiscoverParentRelease, with a manual --ingestor-sa flag on both `cluster info` and `data ingest` as the only escape for customers who set a non-default `ingestionAuthz.serviceAccountName`. A renamed SA made the CLI mint a token jobs-manager then rejected — and `data delete` had no flag at all, so it broke with no workaround. Discover it instead from the chart's `<release>-ingestion-authz` ConfigMap (key `ingestion-authz.yaml`) — the very policy jobs-manager enforces, so it's the authoritative source. New best-effort cluster.discoverIngestorSAName reads `allowed[]`, keeps entries whose `namespace` matches the namespace we mint in (the rendered policy always populates namespace), and requires exactly one distinct `service_account`; a missing ConfigMap (older chart), RBAC denial, empty, or ambiguous policy all keep the "ingestor" default. It never errors — discovery is advisory. With discovery authoritative, --ingestor-sa is removed from `cluster info` and `data ingest` (its acceptance criteria); everything downstream (stage/teardown pods, the jobs-manager token mint, and now `data delete`) reads the discovered release.IngestorSAName. Verified the contract against tracebloc/client templates/ingestion-authz-configmap.yaml: name `<release>-ingestion-authz`, key `ingestion-authz.yaml`, `allowed[].service_account` + per-entry `namespace` — NOT the top-level `serviceAccountName` the issue sketched. Tests: discover_test.go — DiscoversRenamedSAFromConfigMap, AmbiguousSAKeepsDefault, CrossNamespaceSAIgnored (pins the namespace gate); the existing happy-path (no ConfigMap) proves the fallback. Full internal suite + vet + gofmt green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
saadqbal
commented
Jul 8, 2026
Nice — and good catch on the One thing worth a note: the chart supports multiple |
Uh oh!
There was an error while loading. Please reload this page.
saadqbal
commented
Jul 8, 2026
/fr-pass |
Closes#7.
Problem
The ingestor ServiceAccount name was hardcoded to
"ingestor"inDiscoverParentRelease, with a manual--ingestor-saflag oncluster infoanddata ingestas the only escape for customers who set a non-defaultingestionAuthz.serviceAccountName. A renamed SA made the CLI mint a token jobs-manager then rejected — anddata deletehad no such flag at all, so it broke with no workaround.Fix
Discover the SA from the chart's
<release>-ingestion-authzConfigMap (keyingestion-authz.yaml) — the very policy jobs-manager enforces, so it's authoritative. New best-effortcluster.discoverIngestorSAName:allowed[], keeps entries whosenamespacematches the namespace we mint in (the rendered policy always populatesnamespace, defaulting to the release ns),service_account;"ingestor"default. Never errors — discovery is advisory.With discovery authoritative,
--ingestor-sais removed fromcluster infoanddata ingest(per the issue's acceptance criteria). Everything downstream — stage/teardown pods, the jobs-manager token mint, and nowdata delete— reads the discoveredrelease.IngestorSAName. Dropping the flag is safe: the ConfigMap is the enforced policy, so an override to an SA absent from it was rejected server-side anyway — the flag never added real capability.The issue sketched a top-level
serviceAccountNamekey. Verified againsttracebloc/clienttemplates/ingestion-authz-configmap.yaml, the real contract isallowed[].service_account(a list) with per-entrynamespace— building to the sketch would have compiled but never matched.Tests (
internal/cluster/discover_test.go)DiscoversRenamedSAFromConfigMap— renamed SA is discovered (the core fix).AmbiguousSAKeepsDefault— two SAs for one ns → default.CrossNamespaceSAIgnored— entry scoped to another ns is ignored (pins the namespace gate)."ingestor"fallback.Full
internal/...suite +go vet+gofmtgreen.Sequencing: removes the global
--ingestor-safromdata.go's flag block — coordinate merge order with the open ingest-path PR #173 and the planned #76/#77, but the regions differ.🤖 Generated with Claude Code