From 3bc7832d8cec77b1260fda070fab4add207a113c Mon Sep 17 00:00:00 2001 From: "A. F. Dudley" Date: Tue, 3 Feb 2026 01:40:37 -0500 Subject: [PATCH] Fix deployment name extraction from path When stack: field in spec.yml contains a path (e.g., stack_orchestrator/data/stacks/name), extract just the final name component for K8s secret naming. K8s resource names must be valid RFC 1123 subdomains and cannot contain slashes. Co-Authored-By: Claude Opus 4.5 --- stack_orchestrator/deploy/deployment_create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack_orchestrator/deploy/deployment_create.py b/stack_orchestrator/deploy/deployment_create.py index 7f5f5d73..bfa5b3d6 100644 --- a/stack_orchestrator/deploy/deployment_create.py +++ b/stack_orchestrator/deploy/deployment_create.py @@ -843,7 +843,8 @@ def _write_deployment_files( # Copy any config variables from the spec file into an env file suitable for compose # Use stack_name as deployment_name for K8s secret naming - deployment_name = stack_name.replace("_", "-") + # Extract just the name part if stack_name is a path ("path/to/stack" -> "stack") + deployment_name = Path(stack_name).name.replace("_", "-") _write_config_file( spec_file, target_dir.joinpath(constants.config_file_name), deployment_name )