Skip to content

Commit 4f74e03

Browse files
authored
Indent values.yaml using 2 instead of 4 spaces (#9656)
* Generate values.yaml with indentation of 2 Signed-off-by: Alan Clucas <alan@clucas.org> * Fix review comments --------- Signed-off-by: Alan Clucas <alan@clucas.org>
1 parent ec2fe2b commit 4f74e03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

magefiles/helm.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ limitations under the License.
1919
package main
2020

2121
import (
22+
"bytes"
2223
"fmt"
2324
"os"
2425
"strings"
@@ -146,9 +147,12 @@ func updateChartValue(key, value string) {
146147
}
147148

148149
//// write to file
149-
newValueFile, err := yaml.Marshal(&n)
150+
var b bytes.Buffer
151+
yamlEncoder := yaml.NewEncoder(&b)
152+
yamlEncoder.SetIndent(2)
153+
err = yamlEncoder.Encode(&n)
150154
CheckIfError(err, "HELM Could not Marshal new Values file")
151-
err = os.WriteFile(HelmChartValues, newValueFile, 0644)
155+
err = os.WriteFile(HelmChartValues, b.Bytes(), 0644)
152156
CheckIfError(err, "HELM Could not write new Values file to %s", HelmChartValues)
153157

154158
Info("HELM Ingress Nginx Helm Chart update %s %s", key, value)

0 commit comments

Comments
 (0)