summaryrefslogtreecommitdiff
path: root/workhorse
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-15 15:51:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-15 15:51:51 +0000
commitac5bb796c5545cfe6626d39d580c55f2631ac296 (patch)
treec7d4f605f8aebd95b70bf00e3f252566a1667b6c /workhorse
parentc83a8f40f1cd6f0c74c58a19a6f1d9c42de51a95 (diff)
downloadgitlab-ce-ac5bb796c5545cfe6626d39d580c55f2631ac296.tar.gz
Add latest changes from gitlab-org/gitlab@15-0-stable-ee
Diffstat (limited to 'workhorse')
-rw-r--r--workhorse/internal/upload/artifacts_uploader.go8
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 == "" {