diff --git a/src/edge_containers_cli/cmds/helm.py b/src/edge_containers_cli/cmds/helm.py index 4ff49d7e..7527040e 100644 --- a/src/edge_containers_cli/cmds/helm.py +++ b/src/edge_containers_cli/cmds/helm.py @@ -99,7 +99,7 @@ def _install(self, helm_chart: Path): """ shared_vals = "" - if (helm_chart.parent.parent / globals.SHARED_VALUES).exists(): + if (helm_chart.parent.parent.parent / globals.SHARED_VALUES).exists(): shared_vals = f"--values {helm_chart.parent.parent}/values.yaml " helm_cmd = "template" if self.template else "upgrade --install" diff --git a/src/edge_containers_cli/git.py b/src/edge_containers_cli/git.py index 5da824b2..1dd1b84a 100644 --- a/src/edge_containers_cli/git.py +++ b/src/edge_containers_cli/git.py @@ -36,7 +36,7 @@ def create_version_map( ] log.debug(f"service_list = {service_list}") - version_map = {service_item: [] for service_item in service_list} + version_map = {} with chdir(working_dir): # From python 3.11 can use contextlib.chdir(working_dir) result_tags = str(shell.run_command("git tag --sort=committerdate")) @@ -83,9 +83,9 @@ def create_version_map( cmd = f"git cat-file -p {symlink_object_map[symlink]}" result_symlinks = str(shell.run_command(cmd)) symlink_map[symlink] = result_symlinks - cached_git_obj[symlink_object_map[symlink]] = ( - result_symlinks - ) + cached_git_obj[ + symlink_object_map[symlink] + ] = result_symlinks ## Group sources per symlink target target_tree = {} @@ -109,13 +109,16 @@ def create_version_map( # Test each service for changes for service_name in service_list: - change_found = False + shared_change_found = False if shared: - for item in shared: - if item in changed_files: - version_map[service_name].append(tags_list[tag_no]) - change_found = True - if not change_found: + if service_name in version_map: # Consider shared once added + for item in shared: + if item in changed_files: + version_map[service_name].append(tags_list[tag_no]) + shared_change_found = True + if not shared_change_found: + if service_name not in version_map: + version_map[service_name] = [] if os.path.join(root_dir, service_name) in changed_files: version_map[service_name].append(tags_list[tag_no]) diff --git a/src/edge_containers_cli/globals.py b/src/edge_containers_cli/globals.py index 48b1a56c..237d1e7d 100644 --- a/src/edge_containers_cli/globals.py +++ b/src/edge_containers_cli/globals.py @@ -15,6 +15,6 @@ # services directory SERVICES_DIR = "services" # Shared values -SHARED_VALUES = "values.yaml" +SHARED_VALUES = "services/values.yaml" # Time formatting TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"