k8s: extract basename from stack path for labels
Some checks failed
Lint Checks / Run linter (pull_request) Successful in 1m59s
Deploy Test / Run deploy test suite (pull_request) Successful in 4m43s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 4m50s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Failing after 6m0s
Webapp Test / Run webapp test suite (pull_request) Successful in 8m36s
Smoke Test / Run basic test suite (pull_request) Successful in 2m41s

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 <noreply@anthropic.com>
This commit is contained in:
Prathamesh Musale 2026-03-09 12:08:53 +00:00
parent 8769df6c35
commit 8530aa3385

View File

@ -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,