summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-11 17:40:19 +0000
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-11 17:40:19 +0000
commit8a1d584de771b3267374397cc99c019de1c4500c (patch)
tree5179bb8aaf72c674cb3caff3c96758dc20d82747 /internal
parent7b44ce1d4a0716d27acabb4f826eb5613dade082 (diff)
downloadgitlab-shell-8a1d584de771b3267374397cc99c019de1c4500c.tar.gz
refactor: update usage of NewHTTPClient to NewHTTPClientWithOpts
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 5aa99de..41ad7cd 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -15,6 +15,7 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/client"
"gitlab.com/gitlab-org/gitlab-shell/internal/metrics"
+ "gitlab.com/gitlab-org/labkit/log"
)
const (
@@ -97,14 +98,18 @@ func (c *Config) ApplyGlobalState() {
func (c *Config) HttpClient() *client.HttpClient {
c.httpClientOnce.Do(func() {
- client := client.NewHTTPClient(
+ client, err := client.NewHTTPClientWithOpts(
c.GitlabUrl,
c.GitlabRelativeURLRoot,
c.HttpSettings.CaFile,
c.HttpSettings.CaPath,
c.HttpSettings.SelfSignedCert,
c.HttpSettings.ReadTimeoutSeconds,
+ nil,
)
+ if err != nil {
+ log.WithError(err).Fatal("new http client with opts")
+ }
tr := client.Transport
client.Transport = promhttp.InstrumentRoundTripperDuration(metrics.HttpRequestDuration, tr)