From 0da261bc17de6fbe772e10990a76fa1f0151fc45 Mon Sep 17 00:00:00 2001 From: "Jose R. Gonzalez" Date: Wed, 14 Aug 2024 14:25:10 -0500 Subject: [PATCH] Fix bug in values merging when ci directory exists Signed-off-by: Jose R. Gonzalez --- internal/chartverifier/checks/charttesting.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/chartverifier/checks/charttesting.go b/internal/chartverifier/checks/charttesting.go index 9af36388..431e9292 100644 --- a/internal/chartverifier/checks/charttesting.go +++ b/internal/chartverifier/checks/charttesting.go @@ -371,12 +371,13 @@ func newTempValuesFileWithOverrides(filename string, valuesOverrides map[string] if filename != "" { // in the case a filename is provided, read its contents and merge any available values override. - obj, err := readObjectFromYamlFile(filename) + var err error + obj, err = readObjectFromYamlFile(filename) if err != nil { return "", nil, fmt.Errorf("reading values file: %w", err) } - err = mergo.MergeWithOverwrite(&obj, valuesOverrides) + err = mergo.Merge(&obj, valuesOverrides, mergo.WithOverride) if err != nil { return "", nil, fmt.Errorf("merging extra values: %w", err) }