Fix ConfigMap k8s object: read from deployment dir, not spec path

get_configmaps() used the spec's configmap value (a repo-relative
source path) joined with the deployment dir, producing a non-existent
path. ConfigMap files are copied to {deployment_dir}/configmaps/{name}/
by deploy create — read from there instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pull/741/head
Prathamesh Musale 2026-04-14 05:49:11 +00:00
parent 0d4a4e19f5
commit 120f4cdb7b
1 changed files with 9 additions and 3 deletions

View File

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