@@ -29,7 +29,10 @@ var osbuildCmd = "osbuild"
2929type OSBuildOptions struct {
3030 StoreDir string
3131 OutputDir string
32- ExtraEnv []string
32+
33+ Exports []string
34+ Checkpoints []string
35+ ExtraEnv []string
3336
3437 Monitor MonitorType
3538 MonitorFD uintptr
@@ -39,7 +42,7 @@ type OSBuildOptions struct {
3942 CacheMaxSize int64
4043}
4144
42- func NewOSBuildCmd (manifest []byte , exports , checkpoints [] string , optsPtr * OSBuildOptions ) * exec.Cmd {
45+ func NewOSBuildCmd (manifest []byte , optsPtr * OSBuildOptions ) * exec.Cmd {
4346 opts := common .ValueOrEmpty (optsPtr )
4447
4548 cacheMaxSize := int64 (20 * datasizes .GiB )
@@ -56,11 +59,11 @@ func NewOSBuildCmd(manifest []byte, exports, checkpoints []string, optsPtr *OSBu
5659 "-" ,
5760 )
5861
59- for _ , export := range exports {
62+ for _ , export := range opts . Exports {
6063 cmd .Args = append (cmd .Args , "--export" , export )
6164 }
6265
63- for _ , checkpoint := range checkpoints {
66+ for _ , checkpoint := range opts . Checkpoints {
6467 cmd .Args = append (cmd .Args , "--checkpoint" , checkpoint )
6568 }
6669
@@ -84,7 +87,7 @@ func NewOSBuildCmd(manifest []byte, exports, checkpoints []string, optsPtr *OSBu
8487// Note that osbuild returns non-zero when the pipeline fails. This function
8588// does not return an error in this case. Instead, the failure is communicated
8689// with its corresponding logs through osbuild.Result.
87- func RunOSBuild (manifest []byte , exports , checkpoints [] string , errorWriter io.Writer , optsPtr * OSBuildOptions ) (* Result , error ) {
90+ func RunOSBuild (manifest []byte , errorWriter io.Writer , optsPtr * OSBuildOptions ) (* Result , error ) {
8891 opts := common .ValueOrEmpty (optsPtr )
8992
9093 if err := CheckMinimumOSBuildVersion (); err != nil {
@@ -93,7 +96,7 @@ func RunOSBuild(manifest []byte, exports, checkpoints []string, errorWriter io.W
9396
9497 var stdoutBuffer bytes.Buffer
9598 var res Result
96- cmd := NewOSBuildCmd (manifest , exports , checkpoints , & opts )
99+ cmd := NewOSBuildCmd (manifest , & opts )
97100
98101 if opts .JSONOutput {
99102 cmd .Stdout = & stdoutBuffer
@@ -106,8 +109,8 @@ func RunOSBuild(manifest []byte, exports, checkpoints []string, errorWriter io.W
106109 if err != nil {
107110 return nil , fmt .Errorf ("error starting osbuild: %v" , err )
108111 }
109-
110112 err = cmd .Wait ()
113+
111114 if opts .JSONOutput {
112115 // try to decode the output even though the job could have failed
113116 if stdoutBuffer .Len () == 0 {
0 commit comments