Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indent values.yaml using 2 instead of 4 spaces #9656

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions magefiles/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ limitations under the License.
package main

import (
"bytes"
"fmt"
semver "github.com/blang/semver/v4"
"github.com/helm/helm/pkg/chartutil"
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
yamlpath "github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"strings"
)
Expand Down Expand Up @@ -145,9 +147,13 @@ func updateChartValue(key, value string) {
}

//// write to file
newValueFile, err := yaml.Marshal(&n)
var b bytes.Buffer
yamlEncoder := yaml.NewEncoder(&b)
yamlEncoder.SetIndent(2)
yamlEncoder.Encode(&n)
Joibel marked this conversation as resolved.
Show resolved Hide resolved
err = yamlEncoder.Encode(&n)
CheckIfError(err, "HELM Could not Marshal new Values file")
err = os.WriteFile(HelmChartValues, newValueFile, 0644)
err = ioutil.WriteFile(HelmChartValues, b.Bytes(), 0644)
Joibel marked this conversation as resolved.
Show resolved Hide resolved
CheckIfError(err, "HELM Could not write new Values file to %s", HelmChartValues)

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