osbuild-worker: add export path to all upload calls

Exports are defined in all cases now.
This commit is contained in:
Achilleas Koutsou 2021-05-26 00:50:04 +02:00 committed by Tom Gundersen
parent 49a8d98c28
commit 14aea30bcd

View file

@ -219,7 +219,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
key = uuid.New().String() key = uuid.New().String()
} }
_, err = a.Upload(path.Join(outputDirectory, options.Filename), options.Bucket, key) _, err = a.Upload(path.Join(outputDirectory, exportPath, options.Filename), options.Bucket, key)
if err != nil { if err != nil {
appendTargetError(osbuildJobResult, err) appendTargetError(osbuildJobResult, err)
return nil return nil
@ -259,7 +259,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
const azureMaxUploadGoroutines = 4 const azureMaxUploadGoroutines = 4
err = azureStorageClient.UploadPageBlob( err = azureStorageClient.UploadPageBlob(
metadata, metadata,
path.Join(outputDirectory, options.Filename), path.Join(outputDirectory, exportPath, options.Filename),
azureMaxUploadGoroutines, azureMaxUploadGoroutines,
) )
@ -280,7 +280,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
} }
log.Printf("[GCP] 🚀 Uploading image to: %s/%s", options.Bucket, options.Object) log.Printf("[GCP] 🚀 Uploading image to: %s/%s", options.Bucket, options.Object)
_, err = g.StorageObjectUpload(ctx, path.Join(outputDirectory, options.Filename), _, err = g.StorageObjectUpload(ctx, path.Join(outputDirectory, exportPath, options.Filename),
options.Bucket, options.Object, map[string]string{gcp.MetadataKeyImageName: args.Targets[0].ImageName}) options.Bucket, options.Object, map[string]string{gcp.MetadataKeyImageName: args.Targets[0].ImageName})
if err != nil { if err != nil {
appendTargetError(osbuildJobResult, err) appendTargetError(osbuildJobResult, err)
@ -421,7 +421,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
ContainerName: storageContainer, ContainerName: storageContainer,
BlobName: blobName, BlobName: blobName,
}, },
path.Join(outputDirectory, options.Filename), path.Join(outputDirectory, exportPath, options.Filename),
azure.DefaultUploadThreads, azure.DefaultUploadThreads,
) )
if err != nil { if err != nil {