Skip to content

Commit 767c99a

Browse files
Apply suggestions from code review
Co-authored-by: Techassi <git@techassi.dev>
1 parent e331d39 commit 767c99a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.scripts/update_helm_charts.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def local_repo_list():
2020
text=True,
2121
check=True,
2222
)
23-
repo_list = yaml.safe_load(result.stdout)
24-
return repo_list
23+
return yaml.safe_load(result.stdout)
2524

2625

2726
def get_chart_and_app_version(repo_name: str, chart_name: str) -> Tuple[str, str]:
@@ -33,6 +32,8 @@ def get_chart_and_app_version(repo_name: str, chart_name: str) -> Tuple[str, str
3332
check=True,
3433
)
3534
chart_yaml = yaml.safe_load(result.stdout)
35+
# Some charts don't have an appVersion and as such we fallback to a default
36+
# value to not cause lookup errors.
3637
return chart_yaml["version"], chart_yaml.setdefault("appVersion", "Not present")
3738

3839

@@ -79,6 +80,7 @@ def process_yaml_files(top_dir: str) -> None:
7980
continue
8081

8182
chart_version = first_doc["version"]
83+
# Skip chart versions which seem to be templated.
8284
if chart_version.startswith("{{"):
8385
continue
8486

@@ -96,7 +98,6 @@ def process_yaml_files(top_dir: str) -> None:
9698
)
9799

98100
if repo_name not in seen_repos:
99-
# TODO: If the repo exists locally, but with a different URL, let the user know
100101
run_helm_repo_add(repo_name, repo_url)
101102
seen_repos.add(repo_name)
102103

0 commit comments

Comments
 (0)