diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2020-09-21 04:47:01 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2020-09-21 04:47:01 +0000 |
commit | 1a2bfecd2f0ebb8e31f9833e0522c4643797041b (patch) | |
tree | d17cf7bff45492a587027851bb6e0bcb493cff58 /cmd/gitlab-shell/main.go | |
parent | f100e7e83943b3bb5db232f5bf79a616fdba88f1 (diff) | |
parent | a487572a904cc149840488eefdfe121173d8bcb5 (diff) | |
download | gitlab-shell-1a2bfecd2f0ebb8e31f9833e0522c4643797041b.tar.gz |
Merge branch 'sh-extract-context-from-env' into 'master'
Make it possible to propagate correlation ID across processes
Closes #474
See merge request gitlab-org/gitlab-shell!413
Diffstat (limited to 'cmd/gitlab-shell/main.go')
-rw-r--r-- | cmd/gitlab-shell/main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/gitlab-shell/main.go b/cmd/gitlab-shell/main.go index 8df781c..763aa5e 100644 --- a/cmd/gitlab-shell/main.go +++ b/cmd/gitlab-shell/main.go @@ -41,7 +41,10 @@ func main() { os.Exit(1) } - if err = cmd.Execute(); err != nil { + ctx, finished := command.ContextWithCorrelationID() + defer finished() + + if err = cmd.Execute(ctx); err != nil { console.DisplayWarningMessage(err.Error(), readWriter.ErrOut) os.Exit(1) } |