diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-02-25 16:19:08 +0200 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-03-01 15:07:23 +0200 |
commit | 210a5c141c9d76bc9718860d67d77d73997b1534 (patch) | |
tree | e8bfe028d6ecb5ddc269b67283b7b52240323dde /go/internal/handler/handler.go | |
parent | 070691c29891c27f0e46f86f6c89566199ccc54b (diff) | |
download | gitlab-shell-an-distributed-tracing.tar.gz |
Adds distributed tracing instrumentation to GitLab-Shellan-distributed-tracing
Adds distributed tracing instrumentation to GitLab-Shell using LabKit
Diffstat (limited to 'go/internal/handler/handler.go')
-rw-r--r-- | go/internal/handler/handler.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/go/internal/handler/handler.go b/go/internal/handler/handler.go deleted file mode 100644 index f8e8bee..0000000 --- a/go/internal/handler/handler.go +++ /dev/null @@ -1,51 +0,0 @@ -package handler - -import ( - "os" - "os/exec" - "syscall" - - "google.golang.org/grpc" - - "gitlab.com/gitlab-org/gitaly/auth" - "gitlab.com/gitlab-org/gitaly/client" - "gitlab.com/gitlab-org/gitlab-shell/go/internal/config" - "gitlab.com/gitlab-org/gitlab-shell/go/internal/logger" -) - -func Prepare() error { - cfg, err := config.New() - if err != nil { - return err - } - - if err := logger.Configure(cfg); err != nil { - return err - } - - // Use a working directory that won't get removed or unmounted. - if err := os.Chdir("/"); err != nil { - return err - } - - return nil -} - -func execCommand(command string, args ...string) error { - binPath, err := exec.LookPath(command) - if err != nil { - return err - } - - args = append([]string{binPath}, args...) - return syscall.Exec(binPath, args, os.Environ()) -} - -func dialOpts() []grpc.DialOption { - connOpts := client.DefaultDialOpts - if token := os.Getenv("GITALY_TOKEN"); token != "" { - connOpts = append(client.DefaultDialOpts, grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(token))) - } - - return connOpts -} |