Skip to content

Commit 9e0f8dc

Browse files
committed
Revert "Chore: Use dskit/grpc* (#4523)"
This reverts commit 19f3802. Signed-off-by: Arve Knudsen <[email protected]>
1 parent e0807c4 commit 9e0f8dc

36 files changed

+1130
-36
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ require (
3030
github.com/golang/snappy v0.0.4
3131
github.com/gorilla/mux v1.8.0
3232
github.com/grafana/dskit v0.0.0-20220105080720-01ce9286d7d5
33+
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
3334
github.com/json-iterator/go v1.1.12
3435
github.com/lib/pq v1.3.0
3536
github.com/minio/minio-go/v7 v7.0.10

pkg/alertmanager/alertmanager_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"time"
66

77
"github.com/go-kit/log"
8-
"github.com/grafana/dskit/crypto/tls"
9-
"github.com/grafana/dskit/grpcclient"
108
"github.com/grafana/dskit/ring/client"
119
"github.com/pkg/errors"
1210
"github.com/prometheus/client_golang/prometheus"
@@ -15,6 +13,8 @@ import (
1513
"google.golang.org/grpc/health/grpc_health_v1"
1614

1715
"github.com/cortexproject/cortex/pkg/alertmanager/alertmanagerpb"
16+
"github.com/cortexproject/cortex/pkg/util/grpcclient"
17+
"github.com/cortexproject/cortex/pkg/util/tls"
1818
)
1919

2020
// ClientsPool is the interface used to get the client from the pool for a specified address.

pkg/chunk/gcp/bigtable_index_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import (
1212

1313
"cloud.google.com/go/bigtable"
1414
"github.com/go-kit/log"
15-
"github.com/grafana/dskit/grpcclient"
1615
ot "github.com/opentracing/opentracing-go"
1716
"github.com/pkg/errors"
1817

1918
"github.com/cortexproject/cortex/pkg/chunk"
2019
chunk_util "github.com/cortexproject/cortex/pkg/chunk/util"
20+
"github.com/cortexproject/cortex/pkg/util/grpcclient"
2121
"github.com/cortexproject/cortex/pkg/util/math"
2222
"github.com/cortexproject/cortex/pkg/util/spanlogger"
2323
)

pkg/configs/client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"time"
1313

1414
"github.com/go-kit/log/level"
15-
dstls "github.com/grafana/dskit/crypto/tls"
1615
"github.com/grafana/dskit/flagext"
1716
"github.com/prometheus/client_golang/prometheus"
1817
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -21,6 +20,7 @@ import (
2120

2221
"github.com/cortexproject/cortex/pkg/configs/userconfig"
2322
util_log "github.com/cortexproject/cortex/pkg/util/log"
23+
tls_cfg "github.com/cortexproject/cortex/pkg/util/tls"
2424
)
2525

2626
var (
@@ -29,9 +29,9 @@ var (
2929

3030
// Config says where we can find the ruler userconfig.
3131
type Config struct {
32-
ConfigsAPIURL flagext.URLValue `yaml:"configs_api_url"`
33-
ClientTimeout time.Duration `yaml:"client_timeout"` // HTTP timeout duration for requests made to the Weave Cloud configs service.
34-
TLS dstls.ClientConfig `yaml:",inline"`
32+
ConfigsAPIURL flagext.URLValue `yaml:"configs_api_url"`
33+
ClientTimeout time.Duration `yaml:"client_timeout"` // HTTP timeout duration for requests made to the Weave Cloud configs service.
34+
TLS tls_cfg.ClientConfig `yaml:",inline"`
3535
}
3636

3737
// RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet

pkg/cortex/cortex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/go-kit/log"
1414
"github.com/go-kit/log/level"
1515
"github.com/grafana/dskit/flagext"
16-
"github.com/grafana/dskit/grpcutil"
1716
"github.com/grafana/dskit/kv/memberlist"
1817
"github.com/grafana/dskit/modules"
1918
"github.com/grafana/dskit/ring"
@@ -59,6 +58,7 @@ import (
5958
"github.com/cortexproject/cortex/pkg/tenant"
6059
"github.com/cortexproject/cortex/pkg/util"
6160
"github.com/cortexproject/cortex/pkg/util/fakeauth"
61+
"github.com/cortexproject/cortex/pkg/util/grpcutil"
6262
util_log "github.com/cortexproject/cortex/pkg/util/log"
6363
"github.com/cortexproject/cortex/pkg/util/process"
6464
"github.com/cortexproject/cortex/pkg/util/validation"

pkg/distributor/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"sort"
77
"time"
88

9-
"github.com/grafana/dskit/grpcutil"
109
"github.com/grafana/dskit/ring"
1110
"github.com/opentracing/opentracing-go"
1211
"github.com/prometheus/common/model"
@@ -19,6 +18,7 @@ import (
1918
"github.com/cortexproject/cortex/pkg/tenant"
2019
"github.com/cortexproject/cortex/pkg/util"
2120
"github.com/cortexproject/cortex/pkg/util/extract"
21+
"github.com/cortexproject/cortex/pkg/util/grpcutil"
2222
"github.com/cortexproject/cortex/pkg/util/limiter"
2323
"github.com/cortexproject/cortex/pkg/util/validation"
2424
)

pkg/frontend/v2/frontend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/go-kit/log"
1313
"github.com/go-kit/log/level"
1414
"github.com/grafana/dskit/flagext"
15-
"github.com/grafana/dskit/grpcclient"
1615
"github.com/grafana/dskit/services"
1716
"github.com/opentracing/opentracing-go"
1817
"github.com/pkg/errors"
@@ -24,6 +23,7 @@ import (
2423
"github.com/cortexproject/cortex/pkg/frontend/v2/frontendv2pb"
2524
"github.com/cortexproject/cortex/pkg/querier/stats"
2625
"github.com/cortexproject/cortex/pkg/tenant"
26+
"github.com/cortexproject/cortex/pkg/util/grpcclient"
2727
"github.com/cortexproject/cortex/pkg/util/httpgrpcutil"
2828
)
2929

pkg/ingester/client/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"flag"
55

66
"github.com/go-kit/log"
7-
"github.com/grafana/dskit/grpcclient"
87
"github.com/prometheus/client_golang/prometheus"
98
"github.com/prometheus/client_golang/prometheus/promauto"
109
"google.golang.org/grpc"
1110
"google.golang.org/grpc/health/grpc_health_v1"
11+
12+
"github.com/cortexproject/cortex/pkg/util/grpcclient"
1213
)
1314

1415
var ingesterClientRequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{

pkg/ingester/client/cortex_util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/grafana/dskit/grpcutil"
1110
"github.com/stretchr/testify/assert"
1211
"github.com/stretchr/testify/mock"
1312
"github.com/stretchr/testify/require"
1413
"google.golang.org/grpc"
1514
"google.golang.org/grpc/test/bufconn"
1615

16+
"github.com/cortexproject/cortex/pkg/util/grpcutil"
1717
"github.com/cortexproject/cortex/pkg/util/test"
1818
)
1919

pkg/querier/store_gateway_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"time"
66

77
"github.com/go-kit/log"
8-
"github.com/grafana/dskit/crypto/tls"
9-
"github.com/grafana/dskit/grpcclient"
108
"github.com/grafana/dskit/ring/client"
119
"github.com/pkg/errors"
1210
"github.com/prometheus/client_golang/prometheus"
@@ -15,6 +13,8 @@ import (
1513
"google.golang.org/grpc/health/grpc_health_v1"
1614

1715
"github.com/cortexproject/cortex/pkg/storegateway/storegatewaypb"
16+
"github.com/cortexproject/cortex/pkg/util/grpcclient"
17+
"github.com/cortexproject/cortex/pkg/util/tls"
1818
)
1919

2020
func newStoreGatewayClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer) client.PoolFactory {

0 commit comments

Comments
 (0)