From f18293c2f17e7bb1dc40d4cbc1aa0a8ef3361e8a Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Fri, 17 May 2024 19:41:11 +0200 Subject: [PATCH] osbuild-worker-executor: adapt worker-executor to osbuild-composer --- cmd/osbuild-worker-executor/handler_build.go | 1 + cmd/osbuild-worker-executor/handler_build_test.go | 1 - cmd/osbuild-worker-executor/main.go | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/osbuild-worker-executor/handler_build.go b/cmd/osbuild-worker-executor/handler_build.go index 096876ab5..a79fcc2e4 100644 --- a/cmd/osbuild-worker-executor/handler_build.go +++ b/cmd/osbuild-worker-executor/handler_build.go @@ -81,6 +81,7 @@ func runOsbuild(logger *logrus.Logger, buildDir string, control *controlJSON, ou return "", err } + // the result is put into a tar because we get sparse file support for free this way // #nosec G204 cmd = exec.Command( "tar", diff --git a/cmd/osbuild-worker-executor/handler_build_test.go b/cmd/osbuild-worker-executor/handler_build_test.go index 302506163..b7cb05278 100644 --- a/cmd/osbuild-worker-executor/handler_build_test.go +++ b/cmd/osbuild-worker-executor/handler_build_test.go @@ -282,7 +282,6 @@ echo "fake-build-result" > %[1]s/build/output/image/disk.img assert.Equal(t, http.StatusCreated, rsp.StatusCode) reader := bufio.NewReader(rsp.Body) - var lineno, seconds, nano int64 for i := 1; i <= 3; i++ { line, err := reader.ReadString('\n') diff --git a/cmd/osbuild-worker-executor/main.go b/cmd/osbuild-worker-executor/main.go index 2330ea9c8..f08a47a60 100644 --- a/cmd/osbuild-worker-executor/main.go +++ b/cmd/osbuild-worker-executor/main.go @@ -74,7 +74,7 @@ func run(ctx context.Context, args []string, getenv func(string) string, logger func main() { logger := logrus.New() ctx := context.Background() - if err := run(ctx, os.Args, os.Getenv, logger); err != nil { + if err := run(ctx, os.Args[1:], os.Getenv, logger); err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) os.Exit(1) }