Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/artifacts/entry.go')
-rw-r--r--workhorse/internal/artifacts/entry.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/workhorse/internal/artifacts/entry.go b/workhorse/internal/artifacts/entry.go
index d5b3dfb672c..e2eef174989 100644
--- a/workhorse/internal/artifacts/entry.go
+++ b/workhorse/internal/artifacts/entry.go
@@ -16,7 +16,8 @@ import (
"gitlab.com/gitlab-org/labkit/log"
"gitlab.com/gitlab-org/labkit/mask"
- "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper/command"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper/fail"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/senddata"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/zipartifacts"
)
@@ -30,7 +31,7 @@ var SendEntry = &entry{"artifacts-entry:"}
func (e *entry) Inject(w http.ResponseWriter, r *http.Request, sendData string) {
var params entryParams
if err := e.Unpack(&params, sendData); err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendEntry: unpack sendData: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendEntry: unpack sendData: %v", err))
return
}
@@ -41,7 +42,7 @@ func (e *entry) Inject(w http.ResponseWriter, r *http.Request, sendData string)
}).Print("SendEntry: sending")
if params.Archive == "" || params.Entry == "" {
- helper.Fail500(w, r, fmt.Errorf("SendEntry: Archive or Entry is empty"))
+ fail.Request(w, r, fmt.Errorf("SendEntry: Archive or Entry is empty"))
return
}
@@ -50,7 +51,7 @@ func (e *entry) Inject(w http.ResponseWriter, r *http.Request, sendData string)
if os.IsNotExist(err) {
http.NotFound(w, r)
} else if err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendEntry: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendEntry: %v", err))
}
}
@@ -83,7 +84,7 @@ func unpackFileFromZip(ctx context.Context, archivePath, encodedFilename string,
if err := catFile.Start(); err != nil {
return fmt.Errorf("start %v: %v", catFile.Args, err)
}
- defer helper.CleanUpProcessGroup(catFile)
+ defer command.KillProcessGroup(catFile)
basename := filepath.Base(fileName)
reader := bufio.NewReader(stdout)
@@ -114,7 +115,7 @@ func waitCatFile(cmd *exec.Cmd) error {
return nil
}
- st, ok := helper.ExitStatus(err)
+ st, ok := command.ExitStatus(err)
if ok && (st == zipartifacts.CodeArchiveNotFound || st == zipartifacts.CodeEntryNotFound) {
return os.ErrNotExist