Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages to make misconfigurations easier to understand #500

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion flux_local/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,12 @@ async def visit_kustomization(
)
unique = {ks.namespaced_name for ks in kustomizations}
if len(unique) != len(kustomizations):
ks_names = [ks.namespaced_name for ks in kustomizations]
dupes = list(filter(lambda x: ks_names.count(x) > 1, ks_names))
raise FluxException(
"Detected multiple Fluxtomizations with the same name indicating a multi-cluster setup. Please run with a more strict path"
f"Detected multiple Fluxtomizations with the same name: {dupes}. "
"This indicates either (1) an incorrect Kustomization which needs to be fixed "
"or (2) a multi-cluster setup which requires flux-local to run with a more strict --path."
)
return kustomizations

Expand Down
3 changes: 2 additions & 1 deletion flux_local/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ async def template(
if not repo:
raise HelmException(
f"Unable to find HelmRepository for {release.chart.chart_name} for "
f"HelmRelease {release.name}"
f"HelmRelease {release.name} "
f"({len(self._repos)} other HelmRepositories in --path)"
)
args: list[str] = [
HELM_BIN,
Expand Down
Loading