Skip to content

Commit

Permalink
Revendor cortex (#2427)
Browse files Browse the repository at this point in the history
* vendoring bump

* vendoring compat
  • Loading branch information
owen-d authored Jul 28, 2020
1 parent f79f2e8 commit 4a45ca5
Show file tree
Hide file tree
Showing 322 changed files with 16,130 additions and 4,643 deletions.
17 changes: 7 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/cortexproject/cortex v1.2.1-0.20200709155522-19502213923d
github.com/cortexproject/cortex v1.2.1-0.20200727121049-4cfa4a2978c2
github.com/davecgh/go-spew v1.1.1
github.com/docker/docker v17.12.0-ce-rc1.0.20200706150819-a40b877fbb9e+incompatible
github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82 // indirect
Expand Down Expand Up @@ -38,24 +38,23 @@ require (
github.com/klauspost/compress v1.9.5
github.com/mitchellh/mapstructure v1.2.2
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/opentracing/opentracing-go v1.1.1-0.20200124165624-2876d2018785
github.com/opentracing/opentracing-go v1.2.0
github.com/pierrec/lz4 v2.5.3-0.20200429092203-e876bbd321b3+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.10.0
github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c
github.com/prometheus/prometheus v1.8.2-0.20200727090838-6f296594a852
github.com/segmentio/fasthash v1.0.2
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/shurcooL/vfsgen v0.0.0-20200627165143-92b8a710ab6c
github.com/stretchr/testify v1.5.1
github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448
github.com/uber/jaeger-client-go v2.23.1+incompatible
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/ugorji/go v1.1.7 // indirect
github.com/weaveworks/common v0.0.0-20200512154658-384f10054ec5
github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
golang.org/x/net v0.0.0-20200707034311-ab3426394381
google.golang.org/grpc v1.29.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/fsnotify.v1 v1.4.7
Expand All @@ -67,8 +66,6 @@ replace github.com/hpcloud/tail => github.com/grafana/tail v0.0.0-20191024143944

replace github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v36.2.0+incompatible

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.0+incompatible

replace k8s.io/client-go => k8s.io/client-go v0.18.3

// >v1.2.0 has some conflict with prometheus/alertmanager. Hence prevent the upgrade till it's fixed.
Expand Down
113 changes: 105 additions & 8 deletions go.sum

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ func (t *Loki) initRuntimeConfig() (services.Service, error) {
t.cfg.RuntimeConfig.LoadPath = t.cfg.LimitsConfig.PerTenantOverrideConfig
t.cfg.RuntimeConfig.ReloadPeriod = t.cfg.LimitsConfig.PerTenantOverridePeriod
}

if t.cfg.RuntimeConfig.LoadPath == "" {
// no need to initialize module if load path is empty
return nil, nil
}

t.cfg.RuntimeConfig.Loader = loadRuntimeConfig

// make sure to set default limits before we start loading configuration into memory
Expand Down Expand Up @@ -226,7 +232,7 @@ func (t *Loki) initTableManager() (services.Service, error) {
os.Exit(1)
}

tableClient, err := storage.NewTableClient(lastConfig.IndexType, t.cfg.StorageConfig.Config)
tableClient, err := storage.NewTableClient(lastConfig.IndexType, t.cfg.StorageConfig.Config, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
Expand Down
11 changes: 3 additions & 8 deletions pkg/loki/runtime_config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package loki

import (
"os"
"io"

"github.com/cortexproject/cortex/pkg/ring/kv"
"github.com/cortexproject/cortex/pkg/util/runtimeconfig"
Expand All @@ -19,15 +19,10 @@ type runtimeConfigValues struct {
Multi kv.MultiRuntimeConfig `yaml:"multi_kv_config"`
}

func loadRuntimeConfig(filename string) (interface{}, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}

func loadRuntimeConfig(r io.Reader) (interface{}, error) {
var overrides = &runtimeConfigValues{}

decoder := yaml.NewDecoder(f)
decoder := yaml.NewDecoder(r)
decoder.SetStrict(true)
if err := decoder.Decode(&overrides); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewTableClient(name string, cfg Config) (chunk.TableClient, error) {
name = "boltdb"
cfg.FSConfig = cortex_local.FSConfig{Directory: cfg.BoltDBShipperConfig.ActiveIndexDirectory}
}
return storage.NewTableClient(name, cfg.Config)
return storage.NewTableClient(name, cfg.Config, prometheus.DefaultRegisterer)
}

// decodeReq sanitizes an incoming request, rounds bounds, appends the __name__ matcher,
Expand Down
4 changes: 4 additions & 0 deletions pkg/storage/stores/util/object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (p PrefixedObjectClient) Stop() {
p.downstreamClient.Stop()
}

func (p PrefixedObjectClient) PathSeparator() string {
return p.downstreamClient.PathSeparator()
}

func NewPrefixedObjectClient(downstreamClient chunk.ObjectClient, prefix string) chunk.ObjectClient {
return PrefixedObjectClient{downstreamClient: downstreamClient, prefix: prefix}
}
32 changes: 32 additions & 0 deletions vendor/github.com/Azure/go-autorest/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4a45ca5

Please sign in to comment.