Expand ~ in configmap source paths

Configmap paths like ~/.credentials/local-certs/s3 need expanduser
before resolving. The previous fix only handled repo-relative paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pull/742/head
Prathamesh Musale 2026-04-14 06:37:51 +00:00
parent e118fcfbd7
commit 3965f95e59
1 changed files with 5 additions and 6 deletions

View File

@ -1118,12 +1118,11 @@ def _write_deployment_files(
# (user-defined in spec.yml). Fall back to the config/ dir # (user-defined in spec.yml). Fall back to the config/ dir
# convention if no value is provided. # convention if no value is provided.
if configmap_path and not str(configmap_path).startswith("./"): if configmap_path and not str(configmap_path).startswith("./"):
# configmap_path is relative to the repo root (cwd during # User-defined source path. Can be:
# restart). get_stack_path gives us a path like # - repo-relative: "stack-orchestrator/compose/maintenance"
# "stack-orchestrator/stacks/dumpster" — also relative to # - home-relative: "~/.credentials/local-certs/s3"
# repo root. The configmap_path is already repo-relative, # - absolute: "/path/to/dir"
# so use it directly (cwd is repo root during restart). source_config_dir = Path(os.path.expanduser(configmap_path))
source_config_dir = Path(configmap_path)
else: else:
source_config_dir = resolve_config_dir(stack_name, configmap_name) source_config_dir = resolve_config_dir(stack_name, configmap_name)
if os.path.exists(source_config_dir): if os.path.exists(source_config_dir):