// translateEnv translates env value from helm values.yaml tree.
translateEnv translates env value from helm values.yaml tree.
// translateEnv translates env value from helm values . yaml tree .
func translateEnv(outPath string, value interface{}, cpSpecTree map[string]interface{}) error {
	envMap, ok := value.(map[string]interface{})
	if !ok {
		return fmt.Errorf("expect env node type to be map[string]interface{} but got: %T", value)
	}
	outEnv := make([]map[string]interface{}, len(envMap))
	cnt := 0
	for k, v := range envMap {
		outEnv[cnt] = make(map[string]interface{})
		outEnv[cnt]["name"] = k
		outEnv[cnt]["value"] = fmt.Sprintf("%v", v)
		cnt++
	}
	log.Infof("path has value in helm Value.yaml tree, mapping to output path %s", outPath)
	if err := tpath.WriteNode(cpSpecTree, util.ToYAMLPath(outPath), outEnv); err != nil {
		return err
	}
	return nil
}
func translateEnv ( outPath string , value interface { } , cpSpecTree map [ string ] interface { } ) error { envMap , ok := value . ( map [ string ] interface { } ) if ! ok { return fmt . Errorf ( " " , value ) } outEnv := make ( [ ] map [ string ] interface { } , len ( envMap ) ) cnt := 0 for k , v := range envMap { outEnv [ cnt ] = make ( map [ string ] interface { } ) outEnv [ cnt ] [ " " ] = k outEnv [ cnt ] [ " " ] = fmt . Sprintf ( " " , v ) cnt ++ } log . Infof ( " " , outPath ) if err := tpath . WriteNode ( cpSpecTree , util . ToYAMLPath ( outPath ) , outEnv ) ; err != nil { return err } return nil }
translateEnv translates env value from helm values.yaml tree.
translateEnv translates env value from helm values . yaml tree .