Skip to content

Commit

Permalink
remove unused code and reformat (grafana#4155)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d committed Aug 18, 2021
1 parent 8f8f127 commit 3f6f2fc
Showing 1 changed file with 12 additions and 31 deletions.
43 changes: 12 additions & 31 deletions pkg/loki/loki.go
Expand Up @@ -7,36 +7,28 @@ import (
"fmt"
"net/http"

"github.com/cortexproject/cortex/pkg/querier/worker"
"github.com/cortexproject/cortex/pkg/ruler/rulestore"
"github.com/felixge/fgprof"

"github.com/grafana/loki/pkg/runtime"
"github.com/grafana/loki/pkg/storage/stores/shipper/compactor"
"github.com/grafana/loki/pkg/validation"

"github.com/cortexproject/cortex/pkg/util/fakeauth"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck"
"github.com/cortexproject/cortex/pkg/util/modules"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/signals"

cortex_tripper "github.com/cortexproject/cortex/pkg/querier/queryrange"
"github.com/cortexproject/cortex/pkg/querier/worker"
"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/kv/memberlist"
cortex_ruler "github.com/cortexproject/cortex/pkg/ruler"
"github.com/cortexproject/cortex/pkg/ruler/rulestore"
"github.com/cortexproject/cortex/pkg/scheduler"
"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/fakeauth"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck"
util_log "github.com/cortexproject/cortex/pkg/util/log"
"github.com/cortexproject/cortex/pkg/util/modules"
"github.com/cortexproject/cortex/pkg/util/runtimeconfig"
"github.com/cortexproject/cortex/pkg/util/services"

"github.com/felixge/fgprof"
"github.com/go-kit/kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/server"
"google.golang.org/grpc"
"github.com/weaveworks/common/signals"
"google.golang.org/grpc/health/grpc_health_v1"

"github.com/grafana/loki/pkg/distributor"
Expand All @@ -46,9 +38,12 @@ import (
"github.com/grafana/loki/pkg/querier"
"github.com/grafana/loki/pkg/querier/queryrange"
"github.com/grafana/loki/pkg/ruler"
"github.com/grafana/loki/pkg/runtime"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/stores/shipper/compactor"
"github.com/grafana/loki/pkg/tracing"
"github.com/grafana/loki/pkg/validation"
)

// Config is the root config for Loki.
Expand Down Expand Up @@ -240,20 +235,6 @@ func (t *Loki) setupAuthMiddleware() {
})
}

var GRPCStreamAuthInterceptor = func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
switch info.FullMethod {
// Don't check auth header on TransferChunks, as we weren't originally
// sending it and this could cause transfers to fail on update.
//
// Also don't check auth /frontend.Frontend/Process, as this handles
// queries for multiple users.
case "/logproto.Ingester/TransferChunks", "/frontend.Frontend/Process":
return handler(srv, ss)
default:
return middleware.StreamServerUserHeaderInterceptor(srv, ss, info, handler)
}
}

func newDefaultConfig() *Config {
defaultConfig := &Config{}
defaultFS := flag.NewFlagSet("", flag.PanicOnError)
Expand Down

0 comments on commit 3f6f2fc

Please sign in to comment.