-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Charts: Check for output dir conflicts (#710)
Closes #508 Whenever two charts will end up in the same dir, tanka will exit before doing anything Ex, these two versions would end up in the flagger dir: ```yaml directory: charts repositories: - name: flagger url: https://flagger.app requires: - chart: flagger/flagger version: 1.16.1 - chart: flagger/flagger version: 1.17.0 version: 1 ``` ```console $ tk tool charts vendor Error: Output directory conflicts found: - output directory "flagger" is used twice, by charts "flagger/[email protected]" and "flagger/[email protected]" ``` It checks in both `add` and `vendor` commands to handle the case where someone writes their YAML manually
- Loading branch information
1 parent
6ec7c1c
commit 5ac0dfb
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,11 @@ func TestAdd(t *testing.T) { | |
err = c.Add([]string{"stable/[email protected]"}) | ||
assert.EqualError(t, err, "1 Chart(s) were skipped. Please check above logs for details") | ||
|
||
// Adding a chart with a different version to the same path, causes a conflict | ||
err = c.Add([]string{"stable/[email protected]"}) | ||
assert.EqualError(t, err, `Output directory conflicts found: | ||
- output directory "prometheus" is used twice, by charts "stable/[email protected]" and "stable/[email protected]"`) | ||
|
||
// Add a chart with a specific extract directory | ||
err = c.Add([]string{"stable/[email protected]:prometheus-11.12.0"}) | ||
assert.NoError(t, err) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters