From 8530aa338508b8106e9c82744527896897ab63ad Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 9 Mar 2026 12:08:53 +0000 Subject: [PATCH] k8s: extract basename from stack path for labels Stack.name contains the full absolute path from the spec file's "stack:" key (e.g. /home/.../stacks/hyperlane-minio). K8s labels must be <= 63 bytes and alphanumeric. Extract just the directory basename (e.g. "hyperlane-minio") before using it as a label value. Co-Authored-By: Claude Opus 4.6 --- stack_orchestrator/deploy/k8s/deploy_k8s.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index 3003129c..c13f9a55 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -126,7 +126,10 @@ class K8sDeployer(Deployer): # Use deployment-specific namespace for resource isolation and easy cleanup self.k8s_namespace = f"laconic-{compose_project_name}" self.cluster_info = ClusterInfo() - stack_name = deployment_context.stack.name if deployment_context else "" + # stack.name may be an absolute path (from spec "stack:" key after + # path resolution). Extract just the directory basename for labels. + raw_name = deployment_context.stack.name if deployment_context else "" + stack_name = Path(raw_name).name if raw_name else "" self.cluster_info.int( compose_files, compose_env_file,