Skip to content

Commit ee20f76

Browse files
committed
go.mod: update images to v0.209.0
In adapting to the new osbuild/osbuild-exec code, ExportPaths got dropped. This variable / option was not used anywhere anyway. Changes with 0.209.0 ---------------- - gitlab: run ostree manifest generation and builds only when needed (osbuild/images#1961) - Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza - osbuild/osbuild-exec: extract building the osbuild cmd to helper (osbuild/images#1963) - Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Simon de Vlieger - rhel10: add ism secret & top secret oscap profiles (HMS-9507) (osbuild/images#1962) - Author: Gianluca Zuccarelli, Reviewers: Lukáš Zapletal, Sanne Raymaekers
1 parent f1e8449 commit ee20f76

File tree

9 files changed

+83
-89
lines changed

9 files changed

+83
-89
lines changed

cmd/osbuild-worker/jobimpl-osbuild.go

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -518,21 +518,14 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
518518
return err
519519
}
520520

521-
exportPaths := []string{}
522-
for _, jobTarget := range jobArgs.Targets {
523-
exportPaths = append(exportPaths, path.Join(jobTarget.OsbuildArtifact.ExportName, jobTarget.OsbuildArtifact.ExportFilename))
524-
}
525-
526521
logWithId.Infof("Extra env: %q", extraEnv)
527-
opts := &osbuildexecutor.OsbuildOpts{
528-
StoreDir: impl.Store,
529-
OutputDir: outputDirectory,
530-
Exports: exports,
531-
ExportPaths: exportPaths,
532-
ExtraEnv: extraEnv,
533-
Result: true,
522+
opts := &osbuild.OSBuildOptions{
523+
StoreDir: impl.Store,
524+
OutputDir: outputDirectory,
525+
ExtraEnv: extraEnv,
526+
JSONOutput: true,
534527
}
535-
osbuildJobResult.OSBuildOutput, err = executor.RunOSBuild(jobArgs.Manifest, opts, os.Stderr)
528+
osbuildJobResult.OSBuildOutput, err = executor.RunOSBuild(jobArgs.Manifest, exports, nil, os.Stderr, opts)
536529
// First handle the case when "running" osbuild failed
537530
if err != nil {
538531
osbuildJobResult.JobError = clienterrors.New(clienterrors.ErrorBuildJob, "osbuild build failed", err.Error())

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
github.com/oapi-codegen/runtime v1.1.2
3535
github.com/openshift-online/ocm-sdk-go v0.1.478
3636
github.com/osbuild/blueprint v1.16.0
37-
github.com/osbuild/images v0.208.0
37+
github.com/osbuild/images v0.209.0
3838
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d
3939
github.com/prometheus/client_golang v1.23.2
4040
github.com/segmentio/ksuid v1.0.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ github.com/oracle/oci-go-sdk/v54 v54.0.0 h1:CDLjeSejv2aDpElAJrhKpi6zvT/zhZCZuXch
520520
github.com/oracle/oci-go-sdk/v54 v54.0.0/go.mod h1:+t+yvcFGVp+3ZnztnyxqXfQDsMlq8U25faBLa+mqCMc=
521521
github.com/osbuild/blueprint v1.16.0 h1:f/kHih+xpeJ1v7wtIfzdHPZTsiXsqKeDQ1+rrue6298=
522522
github.com/osbuild/blueprint v1.16.0/go.mod h1:HPlJzkEl7q5g8hzaGksUk7ifFAy9QFw9LmzhuFOAVm4=
523-
github.com/osbuild/images v0.208.0 h1:7vkLGfu71v+9zORdgBfxFtpkhNnd2Z6ghw60Fj71vBE=
524-
github.com/osbuild/images v0.208.0/go.mod h1:tZqcrs3eNUA0VPs1h3YCnbnpAskVVfo36CIi2USSfDs=
523+
github.com/osbuild/images v0.209.0 h1:9BRf+N0op1WbQkc+7zVRBZxg4dqS4lty3i2stF3G9lo=
524+
github.com/osbuild/images v0.209.0/go.mod h1:tZqcrs3eNUA0VPs1h3YCnbnpAskVVfo36CIi2USSfDs=
525525
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d h1:r9BFPDv0uuA9k1947Jybcxs36c/pTywWS1gjeizvtcQ=
526526
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d/go.mod h1:zR1iu/hOuf+OQNJlk70tju9IqzzM4ycq0ectkFBm94U=
527527
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=

internal/osbuildexecutor/osbuild-executor.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ import (
66
"github.com/osbuild/images/pkg/osbuild"
77
)
88

9-
type OsbuildOpts struct {
10-
StoreDir string
11-
OutputDir string
12-
Exports []string
13-
ExportPaths []string
14-
Checkpoints []string
15-
ExtraEnv []string
16-
Result bool
17-
}
18-
199
type Executor interface {
20-
RunOSBuild(manifest []byte, opts *OsbuildOpts, errorWriter io.Writer) (*osbuild.Result, error)
10+
RunOSBuild(manifest []byte, exports, checkpoints []string, errorWriter io.Writer, opts *osbuild.OSBuildOptions) (*osbuild.Result, error)
2111
}

internal/osbuildexecutor/runner-impl-aws-ec2.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ type awsEC2Executor struct {
2828
tmpDir string
2929
}
3030

31-
func prepareSources(manifest []byte, store string, extraEnv []string, result bool, errorWriter io.Writer) error {
31+
func prepareSources(manifest []byte, errorWriter io.Writer, opts *osbuild.OSBuildOptions) error {
3232
hostExecutor := NewHostExecutor()
33-
opts := &OsbuildOpts{
34-
StoreDir: store,
35-
ExtraEnv: extraEnv,
36-
Result: result,
37-
}
38-
_, err := hostExecutor.RunOSBuild(manifest, opts, errorWriter)
33+
_, err := hostExecutor.RunOSBuild(manifest, nil, nil, errorWriter, opts)
3934
return err
4035
}
4136

@@ -248,12 +243,8 @@ func extractOutputArchive(outputDirectory, outputTar string) error {
248243

249244
}
250245

251-
func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, opts *OsbuildOpts, errorWriter io.Writer) (*osbuild.Result, error) {
252-
if opts == nil {
253-
opts = &OsbuildOpts{}
254-
}
255-
256-
err := prepareSources(manifest, opts.StoreDir, opts.ExtraEnv, opts.Result, errorWriter)
246+
func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, exports, checkpoints []string, errorWriter io.Writer, opts *osbuild.OSBuildOptions) (*osbuild.Result, error) {
247+
err := prepareSources(manifest, errorWriter, opts)
257248
if err != nil {
258249
return nil, fmt.Errorf("Failed to prepare sources: %w", err)
259250
}
@@ -287,7 +278,7 @@ func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, opts *OsbuildOpts, error
287278
return nil, fmt.Errorf("Timeout waiting for executor to come online")
288279
}
289280

290-
inputArchive, err := writeInputArchive(ec2e.tmpDir, opts.StoreDir, opts.Exports, manifest)
281+
inputArchive, err := writeInputArchive(ec2e.tmpDir, opts.StoreDir, exports, manifest)
291282
if err != nil {
292283
logrus.Errorf("Unable to write input archive: %v", err)
293284
return nil, err

internal/osbuildexecutor/runner-impl-host.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ import (
88

99
type hostExecutor struct{}
1010

11-
func (he *hostExecutor) RunOSBuild(manifest []byte, opts *OsbuildOpts, errorWriter io.Writer) (*osbuild.Result, error) {
12-
if opts == nil {
13-
opts = &OsbuildOpts{}
14-
}
15-
16-
return osbuild.RunOSBuild(manifest, opts.StoreDir, opts.OutputDir, opts.Exports, opts.Checkpoints, opts.ExtraEnv, opts.Result, errorWriter)
11+
func (he *hostExecutor) RunOSBuild(manifest []byte, exports, checkpoints []string, errorWriter io.Writer, opts *osbuild.OSBuildOptions) (*osbuild.Result, error) {
12+
return osbuild.RunOSBuild(manifest, exports, checkpoints, errorWriter, opts)
1713
}
1814

1915
func NewHostExecutor() Executor {

vendor/github.com/osbuild/images/data/distrodefs/distros.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/osbuild/images/pkg/osbuild/osbuild-exec.go

Lines changed: 63 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ github.com/oracle/oci-go-sdk/v54/workrequests
961961
## explicit; go 1.23.9
962962
github.com/osbuild/blueprint/internal/common
963963
github.com/osbuild/blueprint/pkg/blueprint
964-
# github.com/osbuild/images v0.208.0
964+
# github.com/osbuild/images v0.209.0
965965
## explicit; go 1.23.9
966966
github.com/osbuild/images/data/dependencies
967967
github.com/osbuild/images/data/distrodefs

0 commit comments

Comments
 (0)