Skip to content

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

TypeScript

fix(workflow-recipes): run the legacy policy cleanup after the SDK pod and Secret deletes

Alfredo Lopez4868048348b5
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.json
index b636a711c..a1a98981f 100644
--- a/workflow-recipes/package-lock.json
+++ b/workflow-recipes/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.458",
+ "version": "0.1.459",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "workload-recipes-controller",
- "version": "0.1.458",
+ "version": "0.1.459",
"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 cb0e3b3a0..085a788bf 100644
--- a/workflow-recipes/package.json
+++ b/workflow-recipes/package.json
@@ -1,6 +1,6 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.458",
+ "version": "0.1.459",
"description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface",
"main": "dist/main.js",
"engines": {
diff --git a/workflow-recipes/src/workflow/workflowReconciler.ts b/workflow-recipes/src/workflow/workflowReconciler.ts
index 6b0058524..bee490e01 100644
--- a/workflow-recipes/src/workflow/workflowReconciler.ts
+++ b/workflow-recipes/src/workflow/workflowReconciler.ts
@@ -1979,14 +1979,6 @@ export class WorkflowReconciler {
buildLegacyMcpServersInternetEgressPolicyName(recipeName)
)
),
- // The legacy internet policy may carry no labels, while a labeled
- // copy is excluded from the sweeps above. Both forms go through
- // the one live ledger so a completed cleanup can prove `unmanaged`.
- this.cleanupLegacyMcpServersInternetEgress(
- recipeName,
- options.recipeUid,
- options.recipeDeleted === true
- ),
]),
])
if (!preserveWorkflowRuntime) {
@@ -2019,6 +2011,18 @@ export class WorkflowReconciler {
),
]),
])
+ if (!preserveWorkflowRuntime) {
+ // The legacy internet policy may carry no labels, while a labeled copy
+ // is excluded from the sweeps above. Both forms go through the one live
+ // ledger so a completed cleanup can prove `unmanaged`. It runs after the
+ // host pod and token Secrets are gone: a pending legacy DELETE must not
+ // hold the SDK credentials in place.
+ await this.cleanupLegacyMcpServersInternetEgress(
+ recipeName,
+ options.recipeUid,
+ options.recipeDeleted === true
+ )
+ }
await this.assertPluginWorkloadSdkResourcesAbsent(recipeName, ns, networkPolicyNames, {
preserveWorkflowRuntime,
})