Version:"unknown",// TODO: set this to the type/version of spec being parsed.
Yaml:string(yamlData),
ExtensionName:extensionName,
},
}
requestBytes,_:=proto.Marshal(request)
cmd:=exec.Command(extensionHandlers.Name)
cmd.Stdin=bytes.NewReader(requestBytes)
output,err:=cmd.Output()
iferr!=nil{
returnnil,err
}
response:=&extensions.ExtensionHandlerResponse{}
err=proto.Unmarshal(output,response)
iferr!=nil||!response.Handled{
returnnil,err
}
iflen(response.Errors)!=0{
returnnil,fmt.Errorf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v",in,extensionName,extensionHandlers.Name,strings.Join(response.Errors,","))