Skip to content

Commit

Permalink
Fix versions for shared
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls committed Aug 28, 2024
1 parent d23d1ef commit b4a819c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/edge_containers_cli/cmds/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 13 additions & 10 deletions src/edge_containers_cli/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion src/edge_containers_cli/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit b4a819c

Please sign in to comment.