Skip to content

Commit

Permalink
Update flux-local error message for duplicate Kustomizations
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter committed Jan 11, 2024
1 parent c8741a2 commit a541ea9
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit a541ea9

Please sign in to comment.