summaryrefslogtreecommitdiff
path: root/workhorse/internal/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/api/api.go')
-rw-r--r--workhorse/internal/api/api.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go
index db1c4cbbc27..417ee71dbdc 100644
--- a/workhorse/internal/api/api.go
+++ b/workhorse/internal/api/api.go
@@ -3,7 +3,6 @@ package api
import (
"bytes"
"encoding/json"
- "errors"
"fmt"
"io"
"net/http"
@@ -17,12 +16,12 @@ import (
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
- "gitlab.com/gitlab-org/gitlab-workhorse/internal/config"
- "gitlab.com/gitlab-org/gitlab-workhorse/internal/gitaly"
- "gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
- "gitlab.com/gitlab-org/gitlab-workhorse/internal/log"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/config"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/log"
- "gitlab.com/gitlab-org/gitlab-workhorse/internal/secret"
+ "gitlab.com/gitlab-org/gitlab/workhorse/internal/secret"
)
const (
@@ -40,8 +39,6 @@ type API struct {
Version string
}
-var ErrNotGeoSecondary = errors.New("this is not a Geo secondary site")
-
var (
requestsCounter = promauto.NewCounterVec(
prometheus.CounterOpts{
@@ -399,7 +396,6 @@ func validResponseContentType(resp *http.Response) bool {
return helper.IsContentType(ResponseContentType, resp.Header.Get("Content-Type"))
}
-// TODO: Cache the result of the API requests https://gitlab.com/gitlab-org/gitlab/-/issues/329671
func (api *API) GetGeoProxyURL() (*url.URL, error) {
geoProxyApiUrl := *api.URL
geoProxyApiUrl.Path, geoProxyApiUrl.RawPath = joinURLPath(api.URL, geoProxyEndpointPath)
@@ -424,10 +420,6 @@ func (api *API) GetGeoProxyURL() (*url.URL, error) {
return nil, fmt.Errorf("GetGeoProxyURL: decode response: %v", err)
}
- if response.GeoProxyURL == "" {
- return nil, ErrNotGeoSecondary
- }
-
geoProxyURL, err := url.Parse(response.GeoProxyURL)
if err != nil {
return nil, fmt.Errorf("GetGeoProxyURL: Could not parse Geo proxy URL: %v, err: %v", response.GeoProxyURL, err)