Skip to content

Commit

Permalink
fix: imported helm overrides (#2967)
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Ferguson <rjferguson21@gmail.com>
  • Loading branch information
rjferguson21 authored Sep 6, 2024
1 parent 55c3159 commit efa306f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/pkg/packager/composer/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,32 @@ func TestCompose(t *testing.T) {
fmt.Sprintf("%s%svalues.yaml", finalDirectory, string(os.PathSeparator)),
"values.yaml",
},
Variables: []v1alpha1.ZarfChartVariable{
{
Name: "var-today",
Description: "var description",
Path: "path",
},
{
Name: "var-hello",
Description: "var description",
Path: "path",
},
},
},
{
Name: "world",
LocalPath: fmt.Sprintf("%s%schart", firstDirectory, string(os.PathSeparator)),
ValuesFiles: []string{
fmt.Sprintf("%s%svalues.yaml", firstDirectory, string(os.PathSeparator)),
},
Variables: []v1alpha1.ZarfChartVariable{
{
Name: "var-world",
Description: "var description",
Path: "path",
},
},
},
},
// Manifests should be merged if names match and appended if not with corrected directories
Expand Down Expand Up @@ -505,6 +524,13 @@ func createDummyComponent(t *testing.T, name, importDir, subName string) v1alpha
ValuesFiles: []string{
"values.yaml",
},
Variables: []v1alpha1.ZarfChartVariable{
{
Name: fmt.Sprintf("var-%s", name),
Description: "var description",
Path: "path",
},
},
},
},
Manifests: []v1alpha1.ZarfManifest{
Expand Down
1 change: 1 addition & 0 deletions src/pkg/packager/composer/override.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func overrideResources(c *v1alpha1.ZarfComponent, override v1alpha1.ZarfComponen
c.Charts[idx].ReleaseName = overrideChart.ReleaseName
}
c.Charts[idx].ValuesFiles = append(c.Charts[idx].ValuesFiles, overrideChart.ValuesFiles...)
c.Charts[idx].Variables = append(c.Charts[idx].Variables, overrideChart.Variables...)
existing = true
}
}
Expand Down

0 comments on commit efa306f

Please sign in to comment.