osbuildexecutor: wait until worker-executor closes the connection

Otherwise the client will try to fetch the output archive before the
build output is archived on the worker-executor side.
This commit is contained in:
Sanne Raymaekers 2024-06-11 17:02:15 +02:00
parent db43ec8e60
commit 8a5f486715

View file

@ -148,6 +148,11 @@ func handleBuild(inputArchive, host string) (*osbuild.Result, error) {
return nil, fmt.Errorf("Unable to decode response body into osbuild result: %w", err)
}
_, err = io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("Unable to wait for executor to close connection: %w", err)
}
return &osbuildResult, nil
}