Skip to content

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

TypeScript

fix(deploy): project the registry URL into WRC from base, not just minikube

Jose Ramirez7c6feda2cdda
diff --git a/deploy/base/control-plane/workflow-recipes.yaml b/deploy/base/control-plane/workflow-recipes.yaml
index ae854c46f..227b04912 100644
--- a/deploy/base/control-plane/workflow-recipes.yaml
+++ b/deploy/base/control-plane/workflow-recipes.yaml
@@ -84,6 +84,33 @@ spec:
configMapKeyRef:
name: control-api-config
key: CLERUM_WORKFLOW_UI_EGRESS_INTERNAL_MAX_ITEMS
+ # Registry URL — read from the ONE key that defines it
+ # (`control-api-config.CLERUM_REGISTRY_URL`, which control-api itself consumes via
+ # envFrom) rather than a second copy here. Dual-purpose in WRC: API base URL for
+ # the catalog client, and image host for the platform pull-credential predicate.
+ #
+ # The pairing is load-bearing, not tidiness. WRC decides whether to attach the
+ # platform pull credential with `isPlatformRegistryImage(workload.image,
+ # registryUrl)`, comparing the IMAGE host against this URL's host; control-api
+ # provisions that credential from its own copy. When the two disagree — or when
+ # this is left unset, which the predicate treats as "no platform registry" —
+ # control-api still mints and writes the Secret and returns 201, but WRC never
+ # emits `imagePullSecrets`, so recipe pods get `ImagePullBackOff`
+ # (`unauthorized: authentication required`) with an empty pod-level
+ # `imagePullSecrets` while McpServers — whose reference control-api writes itself
+ # — keep working. That asymmetry is risk R3 in
+ # docs/architecture/registry-pull-secret-recipe-workloads.md.
+ #
+ # `optional: true` because the base ConfigMap ships no CLERUM_REGISTRY_URL — only
+ # overlays set it. A hard reference would put a plain `deploy/base` install into
+ # CreateContainerConfigError. Unset stays a valid configuration (no platform
+ # registry); WRC logs a startup WARN so the disabled state is visible.
+ - name: CLERUM_REGISTRY_URL
+ valueFrom:
+ configMapKeyRef:
+ name: control-api-config
+ key: CLERUM_REGISTRY_URL
+ optional: true
# Step output stored in WorkflowRecipe status is only a bounded preview.
# Keep max_steps * preview_chars under the Kubernetes object budget
# (etcd default ~1.5MiB; GKE API server request body commonly ~3MiB).
diff --git a/deploy/overlays/minikube/configmaps/control-api-config.yaml b/deploy/overlays/minikube/configmaps/control-api-config.yaml
index 6906b15d4..d4d5f41d0 100644
--- a/deploy/overlays/minikube/configmaps/control-api-config.yaml
+++ b/deploy/overlays/minikube/configmaps/control-api-config.yaml
@@ -68,11 +68,12 @@ data:
# refuses to start if the configured URL is not allowlisted.
#
# This key is the SINGLE definition of the registry URL for the whole
- # control plane: workflow-recipes projects it via configMapKeyRef
- # (deploy/overlays/minikube/patches/registry-env.yaml) instead of keeping a
- # second copy. Both services must agree, because WRC decides which images
- # are ours — and therefore get the platform pull credential — by comparing
- # the image host against this URL's host. Change it here and WRC follows.
+ # control plane: workflow-recipes projects it via configMapKeyRef in the BASE
+ # Deployment (deploy/base/control-plane/workflow-recipes.yaml) instead of
+ # keeping a second copy, so this overlay only supplies the value. Both
+ # services must agree, because WRC decides which images are ours — and
+ # therefore get the platform pull credential — by comparing the image host
+ # against this URL's host. Change it here and WRC follows.
CLERUM_REGISTRY_URL: 'https://registry.evenfire.ai'
REGISTRY_CONNECTION_MODE: 'self-hosted'
# The Publisher UI (Sidebar entry + /publisher route) defaults ON for every
diff --git a/deploy/overlays/minikube/kustomization.yaml b/deploy/overlays/minikube/kustomization.yaml
index b66ed9880..cebf511c0 100644
--- a/deploy/overlays/minikube/kustomization.yaml
+++ b/deploy/overlays/minikube/kustomization.yaml
@@ -82,8 +82,9 @@ patchesStrategicMerge:
- patches/image-pull-policy.yaml
- patches/service-tokens.yaml
- patches/nginx-workflow-approval-gateway.yaml
- # Registry env vars for workflow-recipes (in-cluster URL, auth off).
- # control-api gets registry env via configmaps/control-api-config.yaml.
+ # Registry auth off for workflow-recipes. The registry URL is NOT patched here:
+ # the base Deployment projects it from configmaps/control-api-config.yaml, the
+ # one key that also feeds control-api.
- patches/registry-env.yaml
# Multi-document YAML must use patchesStrategicMerge — kubectl's embedded
# kustomize (e.g. v4.5.x) rejects the same files under `patches:` with:
diff --git a/deploy/overlays/minikube/patches/registry-env.yaml b/deploy/overlays/minikube/patches/registry-env.yaml
index 7ef17bb99..3f5e62515 100644
--- a/deploy/overlays/minikube/patches/registry-env.yaml
+++ b/deploy/overlays/minikube/patches/registry-env.yaml
@@ -1,22 +1,13 @@
---
-# Minikube: workflow-recipes reads the SAME registry URL as control-api, sourced from the
-# one key that defines it (`control-api-config.CLERUM_REGISTRY_URL`) rather than a second
-# hardcoded copy here.
+# Minikube: registry auth off for workflow-recipes.
#
-# This pairing is load-bearing, not tidiness. WRC decides whether to attach the platform
-# pull credential with `isPlatformRegistryImage(workload.image, registryUrl)`, which
-# compares the IMAGE host against this URL's host. control-api provisions that credential
-# using its own copy. When the two disagree, control-api mints and writes the Secret but
-# WRC never references it, so recipe pods get `ImagePullBackOff`
-# (`unauthorized: authentication required`) with an empty pod-level `imagePullSecrets`
-# while McpServers — whose reference control-api writes itself — keep working. That is
-# risk R3 in docs/architecture/registry-pull-secret-recipe-workloads.md, and it is exactly
-# what this file used to cause: it pinned WRC to the in-cluster registry while
-# control-api pointed at https://registry.evenfire.ai.
-#
-# Sourcing both from one key makes the divergence unrepresentable. Point
-# control-api-config at a different registry (e.g. your own in-cluster deploy) and WRC
-# follows automatically.
+# CLERUM_REGISTRY_URL is deliberately NOT here. The base Deployment projects it from the
+# one key that defines it (`control-api-config.CLERUM_REGISTRY_URL`), and this overlay
+# supplies that key's value in configmaps/control-api-config.yaml — so WRC and control-api
+# read the same URL by construction. Re-declaring the env var here would only add a second
+# place to keep in sync; point the ConfigMap at a different registry (e.g. your own
+# in-cluster deploy) and WRC follows automatically. See the comment on that env entry in
+# deploy/base/control-plane/workflow-recipes.yaml for why divergence is risk R3.
#
# Auth stays disabled here: WRC's catalog client has no machine credentials wired, and
# with auth off it reads anonymously instead of throwing.
@@ -31,10 +22,5 @@ spec:
containers:
- name: workflow-recipes
env:
- - name: CLERUM_REGISTRY_URL
- valueFrom:
- configMapKeyRef:
- name: control-api-config
- key: CLERUM_REGISTRY_URL
- name: CLERUM_REGISTRY_AUTH_ENABLED
value: "false"
diff --git a/docs/architecture/registry-pull-secret-recipe-workloads.md b/docs/architecture/registry-pull-secret-recipe-workloads.md
index db2ae0644..ae86f4f5f 100644
--- a/docs/architecture/registry-pull-secret-recipe-workloads.md
+++ b/docs/architecture/registry-pull-secret-recipe-workloads.md
@@ -277,11 +277,24 @@ service feeds it a different value.
What actually makes it safe is a single *definition*, not a single name:
`control-api-config.CLERUM_REGISTRY_URL` is the only place the URL is written, and WRC
-projects that key via `configMapKeyRef` (`deploy/overlays/minikube/patches/registry-env.yaml`).
-Divergence is then unrepresentable in the overlay rather than merely discouraged. Any other
-overlay (notably the GCP/prod overlay, which lives in `evenfire-infra`) must establish the
-same pairing; WRC's base Deployment sets no `CLERUM_REGISTRY_URL`, so an overlay that
-neither patches it nor projects the key leaves it empty, which disables injection silently.
+projects that key via `configMapKeyRef`. That projection lives in the **base** Deployment
+(`deploy/base/control-plane/workflow-recipes.yaml`), alongside the two workflow limits
+already sourced from the same ConfigMap, so anything built from `deploy/base` inherits the
+pairing and no overlay has to remember it. The reference is `optional: true` because base
+ships no `CLERUM_REGISTRY_URL` key — only overlays set the value — and a hard reference
+would put a plain `deploy/base` install into `CreateContainerConfigError`. The minikube
+overlay consequently no longer redeclares the env var; it only supplies the ConfigMap value
+(`deploy/overlays/minikube/configmaps/control-api-config.yaml`).
+
+Two caveats remain. Overlays that live outside this repo — the GCP dev/prod overlays in
+`evenfire-infra`, and MCC tenant rendering — still set `CLERUM_REGISTRY_URL` for both
+services independently; they agree today, but base cannot enforce that from here. And an
+overlay is still free to leave the key unset, which leaves WRC's value empty and disables
+injection; WRC now logs a startup WARN naming the consequence
+(`registryUrlStartupWarning` in `workflow-recipes/src/config.ts`, printed from `main.ts`)
+rather than failing silently. The base projection is pinned by
+`workflow-recipes/tests/unit/workflow/deployManifest.test.ts` so a later edit cannot quietly
+revert it to a literal or drop it.
### 6.3 One mint, fanned out — the core correctness rule
@@ -519,7 +532,7 @@ working immediately.
| --- | --- | --- |
| R1 | Per-namespace minting revokes other namespaces' keys → partial cluster-wide `ImagePullBackOff`. | Single mint + fan-out write (§6.3); post-condition asserted in tests. |
| R2 | Partial write (mint OK, one namespace fails) leaves a stale, undetectable key. | Fingerprint annotation makes divergence detectable and repairable (§6.3). |
-| R3 | WRC/control-api registry URL drift → recipe pods get no credential while MCP servers do. | **Was live, not hypothetical** — the shipped minikube overlay pinned WRC to the in-cluster registry while control-api used the shared one, so every recipe install hit it (found in live testing 2026-08-04). Closed for this overlay by making `control-api-config.CLERUM_REGISTRY_URL` the single definition and projecting it into WRC via `configMapKeyRef` (§6.2). Shared predicate alone was insufficient. **Still open elsewhere:** WRC's base Deployment sets no default, so any other overlay (GCP/prod in `evenfire-infra`) must repeat the pairing or injection silently disables; surfacing both values on a status/health endpoint is still worth doing. |
+| R3 | WRC/control-api registry URL drift → recipe pods get no credential while MCP servers do. | **Was live, not hypothetical** — the shipped minikube overlay pinned WRC to the in-cluster registry while control-api used the shared one, so every recipe install hit it (found in live testing 2026-08-04). Closed in-repo: the **base** WRC Deployment now projects `control-api-config.CLERUM_REGISTRY_URL` via an `optional: true` `configMapKeyRef`, so every deployment built from `deploy/base` — including OSS self-hosted, the only mode where control-api provisioning actually runs — reads the same definition control-api does, and the minikube overlay no longer redeclares it (§6.2). Pinned by `workflow-recipes/tests/unit/workflow/deployManifest.test.ts`. Shared predicate alone was insufficient. **Residual:** the GCP dev/prod overlays and MCC tenant rendering live outside this repo and still set the value for both services independently (they agree today); and an overlay may still leave the key unset, which disables injection — WRC now emits a startup WARN naming that consequence instead of failing silently. Surfacing both values on a status/health endpoint is still worth doing. |
| R4 | Someone "fixes" #637 denial by labelling the Secret `shared`. | §5.1 recorded as an explicit, permanent non-goal; add a test asserting the Secret is NOT `shared`/`owner-recipe` labeled. |
| R5 | A recipe declares the reserved name and expects it honored. | **Closed.** Validation rejection (§6.1) shipped: `isPlatformManagedWorkflowSecretName` now reserves `EVENFIRE_REGISTRY_PULL_SECRET_NAME`, so `/validate`, POST, PUT and `POST /admin/recipes/secrets` reject the declaration at admission with a reserved-name rule. The #637 gate stays behind it as defense-in-depth for anything already persisted. |
| R6 | Two extra copies of the credential. | Pull-only, org-scoped, no push; §8.2. |
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.json
index 1748c4b47..a548ea6e7 100644
--- a/workflow-recipes/package-lock.json
+++ b/workflow-recipes/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.258",
+ "version": "0.1.260",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "workload-recipes-controller",
- "version": "0.1.258",
+ "version": "0.1.260",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@aws-sdk/client-s3": "^3.1009.0",
diff --git a/workflow-recipes/package.json b/workflow-recipes/package.json
index 1a2ff461c..cc30447db 100644
--- a/workflow-recipes/package.json
+++ b/workflow-recipes/package.json
@@ -1,6 +1,6 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.258",
+ "version": "0.1.260",
"description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface",
"main": "dist/main.js",
"engines": {
diff --git a/workflow-recipes/src/config.test.ts b/workflow-recipes/src/config.test.ts
index afb388420..b6acff47c 100644
--- a/workflow-recipes/src/config.test.ts
+++ b/workflow-recipes/src/config.test.ts
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
-import { loadConfig } from './config'
+import { loadConfig, registryUrlStartupWarning } from './config'
describe('loadConfig', () => {
const originalEnv = process.env
@@ -253,3 +253,37 @@ describe('loadConfig', () => {
expect(config.devMode).toBe(false)
})
})
+
+// An unset/unparseable CLERUM_REGISTRY_URL makes isPlatformRegistryImage() return false
+// for EVERY image, which turns off platform pull-credential injection entirely — while
+// control-api still mints and writes the Secret. Recipe pods then ImagePullBackOff and
+// nothing in the logs says why. This warning is the announcement of that state.
+describe('registryUrlStartupWarning', () => {
+ it('returns null when a parseable registry URL is configured', () => {
+ expect(registryUrlStartupWarning('https://registry.evenfire.ai')).toBeNull()
+ expect(registryUrlStartupWarning('http://registry-api.registry.svc.cluster.local:8085')).toBe(
+ null
+ )
+ })
+
+ it('warns that pull-credential injection is disabled when the URL is unset', () => {
+ for (const unset of ['', ' ']) {
+ const warning = registryUrlStartupWarning(unset)
+ expect(warning).toMatch(/CLERUM_REGISTRY_URL/)
+ expect(warning).toMatch(/not set/)
+ expect(warning).toMatch(/ImagePullBackOff/)
+ }
+ })
+
+ it('warns when the URL is set but unparseable — same silent-disable effect', () => {
+ const warning = registryUrlStartupWarning('registry.evenfire.ai')
+ expect(warning).toMatch(/CLERUM_REGISTRY_URL/)
+ expect(warning).toMatch(/registry\.evenfire\.ai/)
+ expect(warning).toMatch(/ImagePullBackOff/)
+ })
+
+ it('does not depend on ambient env — it reports on the value it is given', () => {
+ process.env.CLERUM_REGISTRY_URL = 'https://registry.evenfire.ai'
+ expect(registryUrlStartupWarning('')).not.toBeNull()
+ })
+})
diff --git a/workflow-recipes/src/config.ts b/workflow-recipes/src/config.ts
index fdaa7e534..0981abdf4 100644
--- a/workflow-recipes/src/config.ts
+++ b/workflow-recipes/src/config.ts
@@ -2,6 +2,7 @@
* Workload Recipes Controller (WRC) configuration.
* Follows the same env-config pattern as host-context-controller/src/config.ts
*/
+import { registryHostFromUrl } from '@clerum/workflow-runtime-core'
export interface DbConfig {
connectionString?: string
@@ -177,6 +178,34 @@ function getNetworkPolicyEnforcementMode(): NetworkPolicyEnforcementMode {
)
}
+/**
+ * Startup warning for a `CLERUM_REGISTRY_URL` the platform-registry predicate cannot use.
+ *
+ * `isPlatformRegistryImage(image, registryUrl)` derives a host from this URL and returns
+ * false for EVERY image when it cannot — so an unset or unparseable value silently turns
+ * off platform image-pull credential injection altogether. control-api still mints and
+ * writes the pull Secret and reports success; WRC just never references it, and recipe
+ * pods sit in ImagePullBackOff with no failing request to attribute it to. Unset is a
+ * legitimate configuration (no platform registry), so this warns rather than throwing —
+ * but it must not be silent. Risk R3 in
+ * docs/architecture/registry-pull-secret-recipe-workloads.md.
+ *
+ * Returns null when the URL yields a host, otherwise the message to log.
+ */
+export function registryUrlStartupWarning(registryUrl: string): string | null {
+ if (registryHostFromUrl(registryUrl)) return null
+ const cause = registryUrl?.trim()
+ ? `CLERUM_REGISTRY_URL="${registryUrl.trim()}" has no parseable host (it needs a scheme, e.g. https://)`
+ : 'CLERUM_REGISTRY_URL is not set'
+ return (
+ `[Clerum] WARN: ${cause} — platform registry image-pull credential injection is DISABLED. ` +
+ 'Recipe workloads whose images come from the platform registry will fail with ImagePullBackOff ' +
+ '("unauthorized: authentication required") even though control-api provisioned the credential. ' +
+ 'Project control-api-config.CLERUM_REGISTRY_URL into this Deployment — see ' +
+ 'deploy/base/control-plane/workflow-recipes.yaml.'
+ )
+}
+
export function loadConfig(): OperatorConfig {
const workflowMaxSteps = getEnvBoundedInt(
'WRC_MAX_WORKFLOW_STEPS',
diff --git a/workflow-recipes/src/main.ts b/workflow-recipes/src/main.ts
index eee49630e..8e8d2fa09 100644
--- a/workflow-recipes/src/main.ts
+++ b/workflow-recipes/src/main.ts
@@ -10,7 +10,7 @@
* Source of truth: PHASE-4-MCP-SERVER-INTERFACE.md §5.4
*/
import * as k8s from '@kubernetes/client-node'
-import { OperatorConfig, loadConfig } from './config'
+import { OperatorConfig, loadConfig, registryUrlStartupWarning } from './config'
import { WorkflowRecipeProvider, createWorkflowRecipeProvider } from './k8sClient'
import { ClerumMcpServer } from './mcp/server'
import { assertInternalControlJwtHmacSecret } from './utils/internalControlSigner'
@@ -87,10 +87,16 @@ async function main(): Promise<void> {
console.log(` Port: ${config.port}`)
console.log(` McpServer namespace: ${config.namespace}`)
console.log(` WorkflowRecipe namespace: ${config.sandboxNamespace}`)
+ console.log(` Registry URL: ${config.registryUrl || '(unset)'}`)
console.log(` NetworkPolicy enforcement mode: ${config.networkPolicyEnforcementMode}`)
console.log(` NetworkPolicy enforcement confirmed: ${config.networkPolicyEnforcementConfirmed}`)
console.log('─────────────────────────────────────────')
+ // A registry URL the platform-registry predicate cannot use disables pull-credential
+ // injection for every workload, silently. Say so once, loudly, at startup.
+ const registryWarning = registryUrlStartupWarning(config.registryUrl)
+ if (registryWarning) console.warn(registryWarning)
+
// Initialize K8s client (shared for validation + MCP server)
const kc = new k8s.KubeConfig()
kc.loadFromDefault()
diff --git a/workflow-recipes/src/reconciler/secretOwnershipBackfill.test.ts b/workflow-recipes/src/reconciler/secretOwnershipBackfill.test.ts
index 2efde8d03..5782b2af7 100644
--- a/workflow-recipes/src/reconciler/secretOwnershipBackfill.test.ts
+++ b/workflow-recipes/src/reconciler/secretOwnershipBackfill.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
+import { EVENFIRE_REGISTRY_PULL_SECRET_NAME } from '@clerum/workflow-runtime-core'
import {
type BackfillNamespaces,
type BackfillRecipe,
@@ -134,6 +135,60 @@ describe('planSecretOwnershipBackfill', () => {
])
})
+ // The platform registry pull credential is control-api-owned infrastructure. It carries
+ // `clerum.io/managed-by: control-api` and NEITHER ownership label, so it reads as
+ // legacy-unlabeled here. A recipe referencing the reserved name — persisted before the
+ // reserved-name validation, or applied straight with kubectl — would otherwise make
+ // `--apply` stamp `clerum.io/owner-recipe` on it, which flips
+ // isSecretAccessibleByRecipe to true and stops the #637 gate from denying and tearing
+ // down that workload. Never a candidate, in any bucket.
+ it('never plans the platform registry pull secret, even with exactly one referencer', () => {
+ const recipes: BackfillRecipe[] = [
+ {
+ name: 'squatter',
+ workloads: [{ id: 'api', imagePullSecrets: [EVENFIRE_REGISTRY_PULL_SECRET_NAME] }],
+ },
+ ]
+ const plan = planSecretOwnershipBackfill(
+ recipes,
+ NS,
+ reader({
+ [`sandbox-recipes/${EVENFIRE_REGISTRY_PULL_SECRET_NAME}`]: {
+ 'clerum.io/managed-by': 'control-api',
+ },
+ })
+ )
+ expect(plan).toEqual({ stamp: [], ambiguous: [], alreadyLabeled: [], missing: [] })
+ })
+
+ it('still stamps genuine unlabeled secrets alongside the excluded platform one', () => {
+ const recipes: BackfillRecipe[] = [
+ {
+ name: 'r',
+ workloads: [
+ {
+ id: 'api',
+ imagePullSecrets: [EVENFIRE_REGISTRY_PULL_SECRET_NAME, 'regcred'],
+ envSecret: { name: 'app-env' },
+ },
+ ],
+ },
+ ]
+ const plan = planSecretOwnershipBackfill(
+ recipes,
+ NS,
+ reader({
+ [`sandbox-recipes/${EVENFIRE_REGISTRY_PULL_SECRET_NAME}`]: {},
+ 'sandbox-recipes/regcred': {},
+ 'sandbox-recipes/app-env': {},
+ })
+ )
+ expect(plan.stamp).toEqual([
+ { namespace: 'sandbox-recipes', secret: 'app-env', ownerRecipe: 'r' },
+ { namespace: 'sandbox-recipes', secret: 'regcred', ownerRecipe: 'r' },
+ ])
+ })
+
it('treats the same secret name in two namespaces independently', () => {
// recipe-a references "creds" from a transport workload (mcp-server),
// recipe-b references a same-named "creds" from a plain workload (sandbox-recipes).
diff --git a/workflow-recipes/src/reconciler/secretOwnershipBackfill.ts b/workflow-recipes/src/reconciler/secretOwnershipBackfill.ts
index 2385e894a..fc74a573f 100644
--- a/workflow-recipes/src/reconciler/secretOwnershipBackfill.ts
+++ b/workflow-recipes/src/reconciler/secretOwnershipBackfill.ts
@@ -21,8 +21,10 @@
// (could be a legitimate shared Secret an operator must mark `clerum.io/shared`,
// or the exact cross-recipe reference #637 guards against) and is never
// auto-claimed. Already-labeled Secrets (including those owned by a different
-// recipe, or conflicting owner+shared) are left untouched.
+// recipe, or conflicting owner+shared) are left untouched. The platform registry
+// pull credential is excluded outright — see the note in `addRef` below.
import {
+ EVENFIRE_REGISTRY_PULL_SECRET_NAME,
OWNER_RECIPE_LABEL_KEY,
SHARED_LABEL_KEY,
parseSecretOwnership,
@@ -197,6 +199,17 @@ export function planSecretOwnershipBackfill(
const refs = new Map<string, string[]>()
const order: string[] = []
const addRef = (namespace: string, name: string, recipe: string) => {
+ // The platform registry pull credential is control-api-owned infrastructure, not a
+ // recipe Secret: control-api writes it into each platform workload namespace labeled
+ // only `clerum.io/managed-by: control-api`. It carries NEITHER ownership label, so
+ // isUnlabeled() reads it as legacy-unlabeled — and a recipe that references the
+ // reserved name (persisted before the reserved-name validation landed, or applied
+ // straight with kubectl) would make `--apply` stamp `clerum.io/owner-recipe` on it.
+ // That would flip isSecretAccessibleByRecipe to true, so the #637 gate would stop
+ // denying and tearing down the very workload it exists to deny — and the claim would
+ // hold until the next mint rewrites the Secret. Never a back-fill candidate: not
+ // stampable, not ambiguous, not reportable as missing.
+ if (name === EVENFIRE_REGISTRY_PULL_SECRET_NAME) return
const key = `${namespace}${SEP}${name}`
let recipesForKey = refs.get(key)
if (!recipesForKey) {
diff --git a/workflow-recipes/tests/unit/workflow/deployManifest.test.ts b/workflow-recipes/tests/unit/workflow/deployManifest.test.ts
index 93fd6f400..c79328415 100644
--- a/workflow-recipes/tests/unit/workflow/deployManifest.test.ts
+++ b/workflow-recipes/tests/unit/workflow/deployManifest.test.ts
@@ -29,4 +29,42 @@ describe('workflow-recipes deployment manifest', () => {
)
}
})
+
+ // Guard for risk R3 in docs/architecture/registry-pull-secret-recipe-workloads.md.
+ // WRC decides whether to attach the platform image-pull credential by comparing the
+ // workload image host against its OWN CLERUM_REGISTRY_URL, while control-api mints and
+ // writes that credential from its copy. When the two disagree — or WRC's is simply
+ // unset, which `isPlatformRegistryImage` treats as "no platform registry" — control-api
+ // still writes the Secret and returns 201, but WRC never emits `imagePullSecrets`, so
+ // recipe pods sit in ImagePullBackOff while McpServer installs keep working (control-api
+ // writes that reference itself). Projecting the ONE key that defines the URL makes the
+ // divergence unrepresentable; a literal here would silently reintroduce it.
+ it('sources the registry URL from the same control-api ConfigMap key, never a literal', () => {
+ const manifest = readRepo('deploy/base/control-plane/workflow-recipes.yaml')
+
+ expect(manifest).toMatch(
+ new RegExp(
+ [
+ '- name: CLERUM_REGISTRY_URL',
+ '\\s+valueFrom:',
+ '\\s+configMapKeyRef:',
+ '\\s+name: control-api-config',
+ '\\s+key: CLERUM_REGISTRY_URL',
+ // The base ConfigMap ships no such key (only overlays set it), so a hard
+ // reference would CreateContainerConfigError on a plain `deploy/base` install.
+ '\\s+optional: true',
+ ].join('\\n')
+ )
+ )
+
+ // Exactly one declaration, and not a hardcoded second copy of the URL.
+ expect(manifest.match(/- name: CLERUM_REGISTRY_URL$/gm)?.length).toBe(1)
+ expect(manifest).not.toMatch(/- name: CLERUM_REGISTRY_URL\n\s+value:/)
+ })
+
+ it('does not let the minikube overlay redeclare the registry URL it already inherits', () => {
+ const patch = readRepo('deploy/overlays/minikube/patches/registry-env.yaml')
+
+ expect(patch).not.toMatch(/- name: CLERUM_REGISTRY_URL$/m)
+ })
})