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()
}
_, 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 {
appendTargetError(osbuildJobResult, err)
return nil
@ -259,7 +259,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
const azureMaxUploadGoroutines = 4
err = azureStorageClient.UploadPageBlob(
metadata,
path.Join(outputDirectory, options.Filename),
path.Join(outputDirectory, exportPath, options.Filename),
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)
_, 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})
if err != nil {
appendTargetError(osbuildJobResult, err)
@ -421,7 +421,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
ContainerName: storageContainer,
BlobName: blobName,
},
path.Join(outputDirectory, options.Filename),
path.Join(outputDirectory, exportPath, options.Filename),
azure.DefaultUploadThreads,
)
if err != nil {