osbuildexecutor: tweak RunOSBuild() signature and use opts

Introduce a new OsbuildOpts struct to make the API a bit easier
to extend and use in the packages.

Also add a new `JobID` field in the `OsbuildOpts`.
This commit is contained in:
Michael Vogt 2024-06-13 16:56:12 +02:00
parent fc1d1c3b8f
commit aa3d70a429
4 changed files with 44 additions and 12 deletions

View file

@ -8,9 +8,12 @@ import (
type hostExecutor struct{}
func (he *hostExecutor) RunOSBuild(manifest []byte, store, outputDirectory string, exports, exportPaths, checkpoints,
extraEnv []string, result bool, errorWriter io.Writer) (*osbuild.Result, error) {
return osbuild.RunOSBuild(manifest, store, outputDirectory, exports, checkpoints, extraEnv, result, errorWriter)
func (he *hostExecutor) RunOSBuild(manifest []byte, opts *OsbuildOpts, errorWriter io.Writer) (*osbuild.Result, error) {
if opts == nil {
opts = &OsbuildOpts{}
}
return osbuild.RunOSBuild(manifest, opts.StoreDir, opts.OutputDir, opts.Exports, opts.Checkpoints, opts.ExtraEnv, opts.Result, errorWriter)
}
func NewHostExecutor() Executor {