worker: handle error when closing osbuild's stdin

This will only happen rarely, but it will be good to know it happened
when it does.
This commit is contained in:
Lars Karlitski 2020-10-25 08:55:05 +01:00
parent 89814c3107
commit 4e46eacd64

View file

@ -43,8 +43,11 @@ func RunOSBuild(manifest distro.Manifest, store, outputDirectory string, errorWr
if err != nil {
return nil, fmt.Errorf("error encoding osbuild pipeline: %v", err)
}
// FIXME: handle or comment this possible error
_ = stdin.Close()
err = stdin.Close()
if err != nil {
return nil, fmt.Errorf("error closing osbuild's stdin: %v", err)
}
var result osbuild.Result
err = json.NewDecoder(stdout).Decode(&result)