Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(control-api): give the H-2 uninstall fixture a readable Secret identity

Diego Zacarias6b7a197372c8
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 4847ffa76..dac8a3f72 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.641",
+ "version": "0.1.642",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.641",
+ "version": "0.1.642",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",
diff --git a/control-api/package.json b/control-api/package.json
index 26cc03598..48ff97068 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.641",
+ "version": "0.1.642",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/routes/admin/__tests__/mcpServerUninstallDeletesOauthClientSecret.test.ts b/control-api/src/routes/admin/__tests__/mcpServerUninstallDeletesOauthClientSecret.test.ts
index 8c6a9271c..eeb9deae1 100644
--- a/control-api/src/routes/admin/__tests__/mcpServerUninstallDeletesOauthClientSecret.test.ts
+++ b/control-api/src/routes/admin/__tests__/mcpServerUninstallDeletesOauthClientSecret.test.ts
@@ -52,7 +52,14 @@ describe('DELETE /admin/mcp-servers/:name — deletes the oauth-client Secret on
deleteSecretCalls.push({ name, namespace })
return {}
}),
- getSecret: vi.fn(async () => ({})),
+ // The uninstall now fences each Secret cleanup on the identity read back
+ // BEFORE the CR delete (uid/resourceVersion precondition), so a live
+ // read must expose that identity exactly as real K8s getSecret does —
+ // returning a bare `{}` would report `identity-unavailable` and skip the
+ // delete, which is not a state a real existing Secret can be in.
+ getSecret: vi.fn(async (name: string) => ({
+ metadata: { uid: `uid-${name}`, resourceVersion: '1' },
+ })),
listResource: vi.fn(async () => []),
updateResource: vi.fn(async () => ({})),
}