// TranslateFromValueToSpec translates from values.yaml value to IstioOperatorSpec.
TranslateFromValueToSpec translates from values.yaml value to IstioOperatorSpec.
// TranslateFromValueToSpec translates from values . yaml value to IstioOperatorSpec .
func (t *ReverseTranslator) TranslateFromValueToSpec(values []byte) (controlPlaneSpec *v1alpha1.IstioOperatorSpec, err error) {
	var yamlTree = make(map[string]interface{})
	err = yaml.Unmarshal(values, &yamlTree)
	if err != nil {
		return nil, fmt.Errorf("error when unmarshalling into untype tree %v", err)
	}
	outputTree := make(map[string]interface{})
	err = t.TranslateTree(yamlTree, outputTree, nil)
	if err != nil {
		return nil, err
	}
	outputVal, err := yaml.Marshal(outputTree)
	if err != nil {
		return nil, err
	}
	var cpSpec = &v1alpha1.IstioOperatorSpec{}
	err = util.UnmarshalWithJSONPB(string(outputVal), cpSpec)
	if err != nil {
		return nil, fmt.Errorf("error when unmarshalling into control plane spec %v, \nyaml:\n %s", err, outputVal)
	}
	return cpSpec, nil
}
func ( t * ReverseTranslator ) TranslateFromValueToSpec ( values [ ] byte ) ( controlPlaneSpec * v1alpha1 . IstioOperatorSpec , err error ) { var yamlTree = make ( map [ string ] interface { } ) err = yaml . Unmarshal ( values , & yamlTree ) if err != nil { return nil , fmt . Errorf ( " " , err ) } outputTree := make ( map [ string ] interface { } ) err = t . TranslateTree ( yamlTree , outputTree , nil ) if err != nil { return nil , err } outputVal , err := yaml . Marshal ( outputTree ) if err != nil { return nil , err } var cpSpec = & v1alpha1 . IstioOperatorSpec { } err = util . UnmarshalWithJSONPB ( string ( outputVal ) , cpSpec ) if err != nil { return nil , fmt . Errorf ( " \n \n " , err , outputVal ) } return cpSpec , nil }
TranslateFromValueToSpec translates from values.yaml value to IstioOperatorSpec.
TranslateFromValueToSpec translates from values . yaml value to IstioOperatorSpec .