func ReadSetValues() error {
	Logger.Debugf("ReadSetValues")
	for _, v := range Values {
		Logger.Debugf("parsing [%s]", v)
		if err := strvals.ParseInto(v, ValuesMap); err != nil {
			return err
		}
	}
	return nil
}
ReadSetValues will add all of the values passed in with --set and store the
values in ValuesMap.
package common
import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/url"
	"os"
	"sigs.k8s.io/yaml"
	"strings"
	"text/template"
	"github.com/Masterminds/sprig/v3"
	log "github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
	"helm.sh/helm/v3/pkg/strvals"
)
const (
	AltLeftDelim = "<<"
	AltRightDelim = ">>"
	DefaultLeftDelim = "{{"
	DefaultRightDelim = "}}"
)
var (
	Logger               = log.New()
	GetSecretsInputFile  string
	GetSecretsOutputFile string
	UseAlternateDelims   bool
	EditInPlace          bool
	Values               []string
	ValuesFiles          []string
	ValuesMap            = map[string]interface{}{}
)
func AddEditInPlaceSupport(cmd *cobra.Command, p *bool) {
	cmd.Flags().BoolVarP(
		p,
		"edit-in-place",
		"",
		false,
		"Enable edit in place, edit input file(s) in place")
}
func AddInputFileSupport(cmd *cobra.Command, p *string) {
	cmd.Flags().StringVarP(
		p,
		"input-file",
		"i",
		"",
		"Input file or stdin")
}
func AddOutputFileSupport(cmd *cobra.Command, p *string) {
	cmd.Flags().StringVarP(
		p,
		"output-file",
		"o",
		"",
		"Output file (prints to stdout by default)")
}
func AddUseAlternateDelimitersSupport(cmd *cobra.Command, p *bool) {
	cmd.Flags().BoolVarP(
		p,
		"use-alt-delims",
		"",
		false,
		"Enable '<< >>' delimiters for go template processing")
}
func AddSetValuesSupport(cmd *cobra.Command, p *[]string) {
	cmd.Flags().StringArrayVar(
		p,
		"set",
		[]string{},
		"set key=value (can specify multiple times to set multiple values)")
}
func AddValuesFileSupport(cmd *cobra.Command, p *[]string) {
	cmd.Flags().StringArrayVar(
		p,
		"values",
		[]string{},
		"values file.yaml (can specify multiple times to set multiple values)")
}
func GetSecrets(files []string, funcMap template.FuncMap) error {
	var data []byte
	var err error
	if len(files) > 0 {
		Logger.Debugf("Processing files: " + strings.Join(files, ","))
		for _, file := range files {
			data, err = ReadFileOrStdin(file)
			if err != nil {
				return err
			}
			if EditInPlace {
				if err :=  parseFile(data, funcMap, file); err != nil {
					return err
				}
			} else {
				if err := parseFile(data, funcMap, ""); err != nil {
					return err
				}
			}
		}
	} else {
		data, err = ReadFileOrStdin(GetSecretsInputFile)
		if err != nil {
			return err
		}
		if EditInPlace {
			return parseFile(data, funcMap, GetSecretsInputFile)
		} else {
			return parseFile(data, funcMap, GetSecretsOutputFile)
		}
	}
	return nil
}
func parseFile(data []byte, funcMap template.FuncMap, file string) error {
	output, err := ParseSecretsTemplate(data, funcMap)
	if err != nil {
		return err
	}
	if err := WriteFileOrStdout(output, file); err != nil {
		return err
	}
	return nil
}