osbuild: add extraEnv argument to RunOSBuild

This adds the ability to supply extra environment variables to
the osbuild process.
This commit is contained in:
Christian Kellner 2022-07-25 10:00:35 +02:00
parent 31072c1189
commit 2c0594629f
3 changed files with 8 additions and 3 deletions

View file

@ -55,7 +55,7 @@ func RunPlayground(img image.ImageKind, d distro.Distro, arch distro.Arch, repos
store := path.Join(state_dir, "osbuild-store")
_, err = osbuild.RunOSBuild(bytes, store, "./", manifest.GetExports(), manifest.GetCheckpoints(), false, os.Stdout)
_, err = osbuild.RunOSBuild(bytes, store, "./", manifest.GetExports(), manifest.GetCheckpoints(), nil, false, os.Stdout)
if err != nil {
fmt.Fprintf(os.Stderr, "could not run osbuild: %s", err.Error())
}

View file

@ -307,7 +307,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
}
// Run osbuild and handle two kinds of errors
osbuildJobResult.OSBuildOutput, err = osbuild.RunOSBuild(jobArgs.Manifest, impl.Store, outputDirectory, exports, nil, true, os.Stderr)
osbuildJobResult.OSBuildOutput, err = osbuild.RunOSBuild(jobArgs.Manifest, impl.Store, outputDirectory, exports, nil, nil, true, os.Stderr)
// First handle the case when "running" osbuild failed
if err != nil {
osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, "osbuild build failed")