summaryrefslogtreecommitdiff
path: root/cmd/gitlab-shell
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2020-09-21 04:47:01 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2020-09-21 04:47:01 +0000
commit1a2bfecd2f0ebb8e31f9833e0522c4643797041b (patch)
treed17cf7bff45492a587027851bb6e0bcb493cff58 /cmd/gitlab-shell
parentf100e7e83943b3bb5db232f5bf79a616fdba88f1 (diff)
parenta487572a904cc149840488eefdfe121173d8bcb5 (diff)
downloadgitlab-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')
-rw-r--r--cmd/gitlab-shell/main.go5
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)
}