From 14052e25dbcb56b114555ced4a13c692977971b7 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Thu, 20 Jun 2024 13:43:01 +0200 Subject: [PATCH] Revert "osbuildexecutor: write the job-id intro control.json" This reverts commit c13d37c3c0004a1d6af627b65ac092b7353e4c14. --- internal/osbuildexecutor/runner-impl-aws-ec2.go | 6 ++---- internal/osbuildexecutor/runner-impl-aws-ec2_test.go | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/internal/osbuildexecutor/runner-impl-aws-ec2.go b/internal/osbuildexecutor/runner-impl-aws-ec2.go index d49beb7a9..be23de914 100644 --- a/internal/osbuildexecutor/runner-impl-aws-ec2.go +++ b/internal/osbuildexecutor/runner-impl-aws-ec2.go @@ -73,17 +73,15 @@ func waitForSI(ctx context.Context, host string) bool { } } -func writeInputArchive(cacheDir, store, jobID string, exports []string, manifestData []byte) (string, error) { +func writeInputArchive(cacheDir, store string, exports []string, manifestData []byte) (string, error) { archive := filepath.Join(cacheDir, "input.tar") control := filepath.Join(cacheDir, "control.json") manifest := filepath.Join(cacheDir, "manifest.json") controlData := struct { Exports []string `json:"exports"` - JobID string `json:"job-id"` }{ Exports: exports, - JobID: jobID, } controlDataBytes, err := json.Marshal(controlData) if err != nil { @@ -289,7 +287,7 @@ func (ec2e *awsEC2Executor) RunOSBuild(manifest []byte, opts *OsbuildOpts, error return nil, fmt.Errorf("Timeout waiting for executor to come online") } - inputArchive, err := writeInputArchive(ec2e.tmpDir, opts.StoreDir, opts.JobID, opts.Exports, manifest) + inputArchive, err := writeInputArchive(ec2e.tmpDir, opts.StoreDir, opts.Exports, manifest) if err != nil { logrus.Errorf("Unable to write input archive: %v", err) return nil, err diff --git a/internal/osbuildexecutor/runner-impl-aws-ec2_test.go b/internal/osbuildexecutor/runner-impl-aws-ec2_test.go index 4261f2160..ed36d6b89 100644 --- a/internal/osbuildexecutor/runner-impl-aws-ec2_test.go +++ b/internal/osbuildexecutor/runner-impl-aws-ec2_test.go @@ -46,7 +46,7 @@ func TestWriteInputArchive(t *testing.T) { require.NoError(t, os.WriteFile(filepath.Join(storeDir, "contents"), []byte("storedata"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(storeSubDir, "contents"), []byte("storedata"), 0600)) - archive, err := osbuildexecutor.WriteInputArchive(cacheDir, storeDir, "some-job-id", []string{"image"}, []byte("{\"version\": 2}")) + archive, err := osbuildexecutor.WriteInputArchive(cacheDir, storeDir, []string{"image"}, []byte("{\"version\": 2}")) require.NoError(t, err) cmd := exec.Command("tar", @@ -64,10 +64,6 @@ func TestWriteInputArchive(t *testing.T) { "store/contents", "", }, strings.Split(string(out), "\n")) - - output, err := exec.Command("tar", "xOf", archive, "control.json").CombinedOutput() - require.NoError(t, err) - require.Equal(t, `{"exports":["image"],"job-id":"some-job-id"}`, string(output)) } func TestHandleBuild(t *testing.T) {