From e39f1eb84147f4f6ebf89414886661bf09bfd2c2 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 16 Jun 2025 18:09:27 +0000 Subject: [PATCH] fix(toolchain): attach tags to function workers --- .../toolchain/src/tasks/deploy/mod.rs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/toolchain/toolchain/src/tasks/deploy/mod.rs b/packages/toolchain/toolchain/src/tasks/deploy/mod.rs index 5752a9c668..4f2a5dddec 100644 --- a/packages/toolchain/toolchain/src/tasks/deploy/mod.rs +++ b/packages/toolchain/toolchain/src/tasks/deploy/mod.rs @@ -176,11 +176,27 @@ async fn create_edge_function_actors( } // Define actor tags for this function - let actor_tags = json!({ + let mut actor_tags = json!({ "type": "function", "function": fn_name, }); + // Use build tags to match the appropriate build + // This is more robust than using a specific build ID + let mut build_tags = json!({ + "name": fn_name, + "current": "true", + "type": "function" + }); + + // Add extra tags to the function tags + if let Some(tags) = &function.build.tags { + for (k, v) in tags { + actor_tags[k] = json!(v); + build_tags[k] = json!(v); + } + } + // List all existing actors for this function let actors_res = apis::actors_api::actors_list( &ctx.openapi_config_cloud, @@ -203,14 +219,6 @@ async fn create_edge_function_actors( existing_actors.insert(actor.region.clone(), actor.id); } - // Use build tags to match the appropriate build - // This is more robust than using a specific build ID - let build_tags = json!({ - "name": fn_name, - "current": "true", - "type": "function" - }); - // Create or upgrade actors for each region for region in ®ion_ids { if existing_regions.contains(region) {