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,