diff options
-rw-r--r-- | workhorse/internal/upload/artifacts_uploader.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/workhorse/internal/upload/artifacts_uploader.go b/workhorse/internal/upload/artifacts_uploader.go index c1c49638e21..3c2d89e976f 100644 --- a/workhorse/internal/upload/artifacts_uploader.go +++ b/workhorse/internal/upload/artifacts_uploader.go @@ -35,6 +35,7 @@ var zipSubcommandsErrorsCounter = promauto.NewCounterVec( }, []string{"error"}) type artifactsUploadProcessor struct { + opts *destination.UploadOpts format string SavedFileTracker @@ -51,7 +52,7 @@ func Artifacts(myAPI *api.API, h http.Handler, p Preparer) http.Handler { format := r.URL.Query().Get(ArtifactFormatKey) - mg := &artifactsUploadProcessor{format: format, SavedFileTracker: SavedFileTracker{Request: r}} + mg := &artifactsUploadProcessor{opts: opts, format: format, SavedFileTracker: SavedFileTracker{Request: r}} interceptMultipartFiles(w, r, h, a, mg, opts) }, "/authorize") } @@ -61,9 +62,12 @@ func (a *artifactsUploadProcessor) generateMetadataFromZip(ctx context.Context, defer metaWriter.Close() metaOpts := &destination.UploadOpts{ - LocalTempPath: os.TempDir(), + LocalTempPath: a.opts.LocalTempPath, TempFilePrefix: "metadata.gz", } + if metaOpts.LocalTempPath == "" { + metaOpts.LocalTempPath = os.TempDir() + } fileName := file.LocalPath if fileName == "" { |