feat(helm):Support reading the values file from STDIN

We can use the command like
<pre>sed "s|foo|bar|g" values-template.yaml | helm install -f - stable/foo</pre>

This may be helpful in scripting.

Closes #2709
pull/2809/head
xuhaigang 7 years ago committed by rocky-nupt
parent 3cf8f2c8b3
commit 084dff477e

@ -310,7 +310,14 @@ func vals(valueFiles valueFiles, values []string) ([]byte, error) {
// User specified a values files via -f/--values
for _, filePath := range valueFiles {
currentMap := map[string]interface{}{}
bytes, err := ioutil.ReadFile(filePath)
var bytes []byte
var err error
if strings.TrimSpace(filePath) == "-" {
bytes, err = ioutil.ReadAll(os.Stdin)
} else {
bytes, err = ioutil.ReadFile(filePath)
}
if err != nil {
return []byte{}, err
}

Loading…
Cancel
Save