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`.
21 lines
484 B
Go
21 lines
484 B
Go
package osbuildexecutor
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/osbuild/images/pkg/osbuild"
|
|
)
|
|
|
|
type hostExecutor struct{}
|
|
|
|
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 {
|
|
return &hostExecutor{}
|
|
}
|