Fix configmap source path resolution for user-defined spec paths (#741)
Lint Checks / Run linter (push) Failing after 0s
Details
Webapp Test / Run webapp test suite (push) Failing after 0s
Details
Smoke Test / Run basic test suite (push) Failing after 0s
Details
Publish / Gate: k8s deploy e2e (push) Failing after 2s
Details
Deploy Test / Run deploy test suite (push) Failing after 0s
Details
Publish / Build and publish (push) Has been skipped
Details
Lint Checks / Run linter (push) Failing after 0s
Details
Webapp Test / Run webapp test suite (push) Failing after 0s
Details
Smoke Test / Run basic test suite (push) Failing after 0s
Details
Publish / Gate: k8s deploy e2e (push) Failing after 2s
Details
Deploy Test / Run deploy test suite (push) Failing after 0s
Details
Publish / Build and publish (push) Has been skipped
Details
parent
0bf1ea70d5
commit
17b614cb4d
|
|
@ -1110,10 +1110,24 @@ def _write_deployment_files(
|
||||||
# Copy configmap directories for k8s deployments (outside the pod loop
|
# Copy configmap directories for k8s deployments (outside the pod loop
|
||||||
# so this works for jobs-only stacks too)
|
# so this works for jobs-only stacks too)
|
||||||
if parsed_spec.is_kubernetes_deployment():
|
if parsed_spec.is_kubernetes_deployment():
|
||||||
for configmap in parsed_spec.get_configmaps():
|
configmaps = parsed_spec.get_configmaps()
|
||||||
source_config_dir = resolve_config_dir(stack_name, configmap)
|
for configmap_name, configmap_path in configmaps.items():
|
||||||
|
# Spec values starting with ./ are deployment-dir destination
|
||||||
|
# paths (written by deploy init for auto-discovered configmaps).
|
||||||
|
# Other values are source paths relative to the stack root
|
||||||
|
# (user-defined in spec.yml). Fall back to the config/ dir
|
||||||
|
# convention if no value is provided.
|
||||||
|
if configmap_path and not str(configmap_path).startswith("./"):
|
||||||
|
# configmap_path is relative to the repo root (cwd during
|
||||||
|
# restart). get_stack_path gives us a path like
|
||||||
|
# "stack-orchestrator/stacks/dumpster" — also relative to
|
||||||
|
# repo root. The configmap_path is already repo-relative,
|
||||||
|
# so use it directly (cwd is repo root during restart).
|
||||||
|
source_config_dir = Path(configmap_path)
|
||||||
|
else:
|
||||||
|
source_config_dir = resolve_config_dir(stack_name, configmap_name)
|
||||||
if os.path.exists(source_config_dir):
|
if os.path.exists(source_config_dir):
|
||||||
destination_config_dir = target_dir.joinpath("configmaps", configmap)
|
destination_config_dir = target_dir.joinpath("configmaps", configmap_name)
|
||||||
copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True)
|
copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True)
|
||||||
|
|
||||||
# Copy the job files into the target dir
|
# Copy the job files into the target dir
|
||||||
|
|
|
||||||
|
|
@ -392,11 +392,17 @@ class ClusterInfo:
|
||||||
print(f"{cfg_map_name} not in pod files")
|
print(f"{cfg_map_name} not in pod files")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cfg_map_path = os.path.expanduser(cfg_map_path)
|
# ConfigMap files live in {deployment_dir}/configmaps/{name}/,
|
||||||
if not cfg_map_path.startswith("/") and self.spec.file_path is not None:
|
# copied there by deploy create / restart from the source path
|
||||||
|
# specified in the spec.
|
||||||
|
if self.spec.file_path is not None:
|
||||||
cfg_map_path = os.path.join(
|
cfg_map_path = os.path.join(
|
||||||
os.path.dirname(str(self.spec.file_path)), cfg_map_path
|
os.path.dirname(str(self.spec.file_path)),
|
||||||
|
"configmaps",
|
||||||
|
cfg_map_name,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
cfg_map_path = os.path.expanduser(cfg_map_path)
|
||||||
|
|
||||||
# Read in all the files at a single-level of the directory.
|
# Read in all the files at a single-level of the directory.
|
||||||
# This mimics the behavior of
|
# This mimics the behavior of
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue