mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 00:02:29 +00:00
Copies the private repository's relay side: the IAM-only fence broker, the operations console and incident monitor, the relay Terraform root with its backend configuration and tfvars, and the deploy/capacity/admission/rehome/ monitoring scripts the workflows call, with their contract tests, contracts, and fixtures. The foundation and apps Terraform roots and the API and auth services stay private. Four surfaces that spanned both trees are narrowed to the relay side rather than left with a dangling read: the infra runner and the root-partition and workload-identity-condition renderers now declare only the relay root, and the Cloud SQL rollout census drops the six app workflows that are not here.
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
import { readProductionCapacityIdentity } from './read-relay-production-capacity-identity.mjs'
|
|
|
|
function revision(env) {
|
|
return { spec: { containers: [{ env }] } }
|
|
}
|
|
|
|
test('reads absent, exact, and foreign literal capacity identities', () => {
|
|
assert.equal(readProductionCapacityIdentity(revision([])), null)
|
|
assert.equal(
|
|
readProductionCapacityIdentity(revision([
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: 'capacity@example.test' }
|
|
])),
|
|
'capacity@example.test'
|
|
)
|
|
assert.equal(
|
|
readProductionCapacityIdentity(revision([
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: 'foreign@example.test' }
|
|
])),
|
|
'foreign@example.test'
|
|
)
|
|
})
|
|
|
|
test('rejects malformed or duplicate capacity identity entries', () => {
|
|
for (const entry of [
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: null },
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: '' },
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', valueSource: { secretKeyRef: {} } }
|
|
]) {
|
|
assert.throws(
|
|
() => readProductionCapacityIdentity(revision([entry])),
|
|
/not a literal string/
|
|
)
|
|
}
|
|
assert.throws(
|
|
() => readProductionCapacityIdentity(revision([
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: 'one@example.test' },
|
|
{ name: 'ORCA_RELAY_CAPACITY_SERVICE_ACCOUNT', value: 'two@example.test' }
|
|
])),
|
|
/duplicate capacity identity/
|
|
)
|
|
assert.throws(() => readProductionCapacityIdentity({}), /environment is missing/)
|
|
})
|