Skip to content

Commit

Permalink
fix: imported helm overrides
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Ferguson <[email protected]>
  • Loading branch information
rjferguson21 committed Sep 5, 2024
1 parent 93128e8 commit 9901c50
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/internal/packager/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func Push(ctx context.Context, cfg PushConfig) error {
registryURL = cfg.RegInfo.Address
)

progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
defer progress.Close()

err = retry.Do(func() error {
c, _ := cluster.NewCluster()
if c != nil {
Expand All @@ -65,8 +68,7 @@ func Push(ctx context.Context, cfg PushConfig) error {
}
}

progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
defer progress.Close()
progress = message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
pushOptions := createPushOpts(cfg, progress)

pushImage := func(img v1.Image, name string) error {
Expand Down Expand Up @@ -122,13 +124,14 @@ func Push(ctx context.Context, cfg PushConfig) error {
pushed = append(pushed, refInfo)
totalSize -= size
}
progress.Successf("Pushed %d images", len(cfg.ImageList))
return nil
}, retry.Context(ctx), retry.Attempts(uint(cfg.Retries)), retry.Delay(500*time.Millisecond))
if err != nil {
return err
}

progress.Successf("Pushed %d images", len(cfg.ImageList))

return nil
}

Expand Down
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 9901c50

Please sign in to comment.