From 7e716b61ed391dffabb77a872d19ced3115388a8 Mon Sep 17 00:00:00 2001 From: CMGS Date: Mon, 30 Aug 2021 16:11:13 +0800 Subject: [PATCH] remove unecessary context (#465) * remove unecessary context * nolint for nil Co-authored-by: anrs --- client/interceptor/retry.go | 2 +- client/resolver/eru/resolver.go | 8 ++++---- client/utils/servicepusher.go | 11 ++++++----- cluster/calcium/build.go | 2 +- cluster/calcium/calcium.go | 4 ++-- cluster/calcium/create.go | 2 +- cluster/calcium/lock.go | 2 +- cluster/calcium/resource.go | 2 +- cluster/calcium/wal.go | 2 +- core.go | 22 ++++++++++----------- discovery/helium/helium.go | 4 ++-- go.mod | 2 +- go.sum | 34 --------------------------------- metrics/handler.go | 4 ++-- metrics/metrics.go | 19 +++++++++--------- rpc/rpc.go | 2 +- store/redis/ephemeral.go | 2 +- utils/transaction.go | 4 ++-- wal/hydro.go | 6 +++--- wal/wal_test.go | 2 +- 20 files changed, 51 insertions(+), 85 deletions(-) diff --git a/client/interceptor/retry.go b/client/interceptor/retry.go index ceb1f169a..22055d079 100644 --- a/client/interceptor/retry.go +++ b/client/interceptor/retry.go @@ -57,7 +57,7 @@ func (s *retryStream) RecvMsg(m interface{}) (err error) { } return backoff.Retry(func() error { - log.Debug(context.TODO(), "[retryStream] retry on new stream") + log.Debug(nil, "[retryStream] retry on new stream") //nolint stream, err := s.newStream() if err != nil { // even io.EOF triggers retry, and it's what we want! diff --git a/client/resolver/eru/resolver.go b/client/resolver/eru/resolver.go index 93df888f0..b779baac7 100644 --- a/client/resolver/eru/resolver.go +++ b/client/resolver/eru/resolver.go @@ -44,10 +44,10 @@ func (r *Resolver) Close() { } func (r *Resolver) sync() { - log.Debug(context.TODO(), "[EruResolver] start sync service discovery") - ctx, cancel := context.WithCancel(context.Background()) - r.cancel = cancel - defer cancel() + ctx := context.TODO() + log.Debug(ctx, "[EruResolver] start sync service discovery") + ctx, r.cancel = context.WithCancel(ctx) + defer r.cancel() ch, err := r.discovery.Watch(ctx) if err != nil { diff --git a/client/utils/servicepusher.go b/client/utils/servicepusher.go index 4fad58bc1..361cfd74d 100644 --- a/client/utils/servicepusher.go +++ b/client/utils/servicepusher.go @@ -53,7 +53,7 @@ func (p *EndpointPusher) delOutdated(endpoints []string) { if _, ok := newEps[ep]; !ok { cancel() p.pendingEndpoints.Delete(ep) - log.Debugf(context.TODO(), "[EruResolver] pending endpoint deleted: %s", ep) + log.Debugf(nil, "[EruResolver] pending endpoint deleted: %s", ep) //nolint } return true }) @@ -66,7 +66,7 @@ func (p *EndpointPusher) delOutdated(endpoints []string) { } if _, ok := newEps[ep]; !ok { p.availableEndpoints.Delete(ep) - log.Debugf(context.TODO(), "[EruResolver] available endpoint deleted: %s", ep) + log.Debugf(nil, "[EruResolver] available endpoint deleted: %s", ep) //nolint } return true }) @@ -81,16 +81,17 @@ func (p *EndpointPusher) addCheck(endpoints []string) { continue } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.TODO()) p.pendingEndpoints.Store(endpoint, cancel) go p.pollReachability(ctx, endpoint) log.Debugf(ctx, "[EruResolver] pending endpoint added: %s", endpoint) } } + func (p *EndpointPusher) pollReachability(ctx context.Context, endpoint string) { parts := strings.Split(endpoint, ":") if len(parts) != 2 { - log.Errorf(context.TODO(), "[EruResolver] wrong format of endpoint: %s", endpoint) + log.Errorf(ctx, "[EruResolver] wrong format of endpoint: %s", endpoint) return } @@ -118,7 +119,7 @@ func (p *EndpointPusher) pollReachability(ctx context.Context, endpoint string) func (p *EndpointPusher) checkReachability(host string) (err error) { pinger, err := ping.NewPinger(host) if err != nil { - log.Errorf(context.TODO(), "[EruResolver] failed to create pinger: %+v", err) + log.Errorf(nil, "[EruResolver] failed to create pinger: %+v", err) //nolint return } defer pinger.Stop() diff --git a/cluster/calcium/build.go b/cluster/calcium/build.go index 8e8777541..96f3ffbb6 100644 --- a/cluster/calcium/build.go +++ b/cluster/calcium/build.go @@ -180,7 +180,7 @@ func withImageBuiltChannel(f func(chan *types.BuildImageMessage)) chan *types.Bu func cleanupNodeImages(ctx context.Context, node *types.Node, ids []string, ttl time.Duration) { logger := log.WithField("Calcium", "cleanupNodeImages").WithField("node", node).WithField("ids", ids).WithField("ttl", ttl) - ctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.Background()), ttl) + ctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.TODO()), ttl) defer cancel() for _, id := range ids { if _, err := node.Engine.ImageRemove(ctx, id, false, true); err != nil { diff --git a/cluster/calcium/calcium.go b/cluster/calcium/calcium.go index 3d50139ca..9344565ca 100644 --- a/cluster/calcium/calcium.go +++ b/cluster/calcium/calcium.go @@ -71,7 +71,7 @@ func New(config types.Config, t *testing.T) (*Calcium, error) { log.Warn("[Calcium] SCM not set, build API disabled") } if err != nil { - logger.Errorf(context.TODO(), "[Calcium] SCM failed: %+v", err) + logger.Errorf(nil, "[Calcium] SCM failed: %+v", err) //nolint return nil, errors.WithStack(err) } @@ -81,7 +81,7 @@ func New(config types.Config, t *testing.T) (*Calcium, error) { cal := &Calcium{store: store, config: config, scheduler: potassium, source: scm, watcher: watcher} cal.wal, err = newCalciumWAL(cal) cal.identifier = config.Identifier() - return cal, logger.Err(context.TODO(), errors.WithStack(err)) + return cal, logger.Err(nil, errors.WithStack(err)) //nolint } // DisasterRecover . diff --git a/cluster/calcium/create.go b/cluster/calcium/create.go index ccac4f872..c02b89f56 100644 --- a/cluster/calcium/create.go +++ b/cluster/calcium/create.go @@ -53,7 +53,7 @@ func (c *Calcium) doCreateWorkloads(ctx context.Context, opts *types.DeployOptio utils.SentryGo(func() { defer func() { - cctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.Background()), c.config.GlobalTimeout) + cctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.TODO()), c.config.GlobalTimeout) for nodename := range deployMap { if e := c.store.DeleteProcessing(cctx, opts.GetProcessing(nodename)); e != nil { logger.Errorf(ctx, "[Calcium.doCreateWorkloads] delete processing failed for %s: %+v", nodename, e) diff --git a/cluster/calcium/lock.go b/cluster/calcium/lock.go index 1c0b48c2b..5295e64d4 100644 --- a/cluster/calcium/lock.go +++ b/cluster/calcium/lock.go @@ -20,7 +20,7 @@ func (c *Calcium) doLock(ctx context.Context, name string, timeout time.Duration } defer func() { if err != nil { - rollbackCtx, cancel := context.WithTimeout(context.Background(), timeout) + rollbackCtx, cancel := context.WithTimeout(context.TODO(), timeout) defer cancel() rollbackCtx = utils.InheritTracingInfo(rollbackCtx, ctx) if e := lock.Unlock(rollbackCtx); e != nil { diff --git a/cluster/calcium/resource.go b/cluster/calcium/resource.go index 183018275..f859ee656 100644 --- a/cluster/calcium/resource.go +++ b/cluster/calcium/resource.go @@ -228,7 +228,7 @@ func (c *Calcium) remapResource(ctx context.Context, node *types.Node) (ch <-cha func (c *Calcium) doRemapResourceAndLog(ctx context.Context, logger log.Fields, node *types.Node) { log.Debugf(ctx, "[doRemapResourceAndLog] remap node %s", node.Name) - ctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.Background()), c.config.GlobalTimeout) + ctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.TODO()), c.config.GlobalTimeout) defer cancel() logger = logger.WithField("Calcium", "doRemapResourceAndLog").WithField("nodename", node.Name) if ch, err := c.remapResource(ctx, node); logger.Err(ctx, err) == nil { diff --git a/cluster/calcium/wal.go b/cluster/calcium/wal.go index a1bd1c4cf..aa7a9ce2d 100644 --- a/cluster/calcium/wal.go +++ b/cluster/calcium/wal.go @@ -202,7 +202,7 @@ func (h *CreateLambdaHandler) Handle(ctx context.Context, raw interface{}) error workloadIDs, err := h.getWorkloadIDs(ctx, opts) if err != nil { - log.Errorf(context.TODO(), "[CreateLambdaHandler.Handle] Get workloads %s/%s/%v failed: %v", + log.Errorf(nil, "[CreateLambdaHandler.Handle] Get workloads %s/%s/%v failed: %v", //nolint opts.Appname, opts.Entrypoint, opts.Labels, err) return err } diff --git a/core.go b/core.go index 472ead01a..c51428dcb 100644 --- a/core.go +++ b/core.go @@ -1,12 +1,13 @@ package main import ( - "context" "fmt" "net" "net/http" _ "net/http/pprof" // nolint "os" + "os/signal" + "syscall" "testing" "time" @@ -20,7 +21,6 @@ import ( "github.com/projecteru2/core/utils" "github.com/projecteru2/core/version" "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/sethvargo/go-signalcontext" cli "github.com/urfave/cli/v2" "google.golang.org/grpc" @@ -61,13 +61,13 @@ func serve(c *cli.Context) error { } if sentryDefer, err := setupSentry(config.SentryDSN); err != nil { - log.Warnf(context.TODO(), "[main] sentry %v", err) + log.Warnf(nil, "[main] sentry %v", err) //nolint } else if sentryDefer != nil { defer sentryDefer() } if err := metrics.InitMetrics(config); err != nil { - log.Errorf(context.TODO(), "[main] %v", err) + log.Errorf(nil, "[main] %v", err) //nolint return err } @@ -77,7 +77,7 @@ func serve(c *cli.Context) error { } cluster, err := calcium.New(config, t) if err != nil { - log.Errorf(context.TODO(), "[main] %v", err) + log.Errorf(nil, "[main] %v", err) //nolint return err } defer cluster.Finalizer() @@ -87,7 +87,7 @@ func serve(c *cli.Context) error { vibranium := rpc.New(cluster, config, stop) s, err := net.Listen("tcp", config.Bind) if err != nil { - log.Errorf(context.TODO(), "[main] %v", err) + log.Errorf(nil, "[main] %v", err) //nolint return err } @@ -101,14 +101,14 @@ func serve(c *cli.Context) error { auth := auth.NewAuth(config.Auth) opts = append(opts, grpc.StreamInterceptor(auth.StreamInterceptor)) opts = append(opts, grpc.UnaryInterceptor(auth.UnaryInterceptor)) - log.Infof(context.TODO(), "[main] Username %s Password %s", config.Auth.Username, config.Auth.Password) + log.Infof(nil, "[main] Username %s Password %s", config.Auth.Username, config.Auth.Password) //nolint } grpcServer := grpc.NewServer(opts...) pb.RegisterCoreRPCServer(grpcServer, vibranium) utils.SentryGo(func() { if err := grpcServer.Serve(s); err != nil { - log.Errorf(context.TODO(), "[main] start grpc failed %v", err) + log.Errorf(nil, "[main] start grpc failed %v", err) //nolint } }) @@ -116,20 +116,20 @@ func serve(c *cli.Context) error { http.Handle("/metrics", metrics.Client.ResourceMiddleware(cluster)(promhttp.Handler())) utils.SentryGo(func() { if err := http.ListenAndServe(config.Profile, nil); err != nil { - log.Errorf(context.TODO(), "[main] start http failed %v", err) + log.Errorf(nil, "[main] start http failed %v", err) //nolint } }) } unregisterService, err := cluster.RegisterService(c.Context) if err != nil { - log.Errorf(context.TODO(), "[main] failed to register service: %v", err) + log.Errorf(nil, "[main] failed to register service: %v", err) //nolint return err } log.Info("[main] Cluster started successfully.") // wait for unix signals and try to GracefulStop - ctx, cancel := signalcontext.OnInterrupt() + ctx, cancel := signal.NotifyContext(c.Context, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) defer cancel() <-ctx.Done() diff --git a/discovery/helium/helium.go b/discovery/helium/helium.go index 46fdfa4d2..fe353d737 100644 --- a/discovery/helium/helium.go +++ b/discovery/helium/helium.go @@ -25,7 +25,7 @@ func New(config types.GRPCConfig, stor store.Store) *Helium { h.config = config h.stor = stor h.Do(func() { - h.start(context.TODO()) // rewrite ctx here, because this will run only once! + h.start(context.TODO()) // TODO rewrite ctx here, because this will run only once! }) return h } @@ -45,7 +45,7 @@ func (h *Helium) Unsubscribe(id uuid.UUID) { func (h *Helium) start(ctx context.Context) { ch, err := h.stor.ServiceStatusStream(ctx) if err != nil { - log.Errorf(context.TODO(), "[WatchServiceStatus] failed to start watch: %v", err) + log.Errorf(nil, "[WatchServiceStatus] failed to start watch: %v", err) //nolint return } diff --git a/go.mod b/go.mod index 0e3712646..6546b97e8 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/go-git/go-git/v5 v5.2.0 github.com/go-ping/ping v0.0.0-20210407214646-e4e642a95741 github.com/go-redis/redis/v8 v8.8.2 + github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.1.2 github.com/gorilla/mux v1.7.4 // indirect github.com/jinzhu/configor v1.2.0 @@ -35,7 +36,6 @@ require ( github.com/projecteru2/libyavirt v0.0.0-20210514093713-959b2e232319 github.com/prometheus/client_golang v1.11.0 github.com/sanity-io/litter v1.5.1 - github.com/sethvargo/go-signalcontext v0.1.0 github.com/sirupsen/logrus v1.7.0 github.com/stretchr/testify v1.7.0 github.com/urfave/cli/v2 v2.2.0 diff --git a/go.sum b/go.sum index d93b1be44..83f04a2db 100644 --- a/go.sum +++ b/go.sum @@ -5,7 +5,6 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= @@ -31,30 +30,25 @@ github.com/Microsoft/hcsshim v0.8.11/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexcesaro/statsd v2.0.0+incompatible h1:HG17k1Qk8V1F4UOoq6tx+IUoAbOcI5PHzzEUGeDD72w= github.com/alexcesaro/statsd v2.0.0+incompatible/go.mod h1:vNepIbQAiyLe1j480173M6NYYaAsGwEcvuDTU3OCUGY= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.14.3 h1:QWoo2wchYmLgOB6ctlTt2dewQ1Vu6phl+iQbwT8SYGo= github.com/alicebob/miniredis/v2 v2.14.3/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -66,7 +60,6 @@ github.com/cenkalti/backoff/v4 v4.0.2 h1:JIufpQLbh4DkbQoii76ItQIUFzevQSqOLZca4ea github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -81,11 +74,8 @@ github.com/cilium/ebpf v0.5.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4 h1:Lap807SXTH5tri2TivECb/4abUkMZC9zRoLarvcKDqs= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= @@ -123,7 +113,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -146,7 +135,6 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= @@ -170,26 +158,21 @@ github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNy github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/getsentry/sentry-go v0.9.0 h1:KIfpY/D9hX3gWAEd3d8z6ImuHNWtqEsjlpdF8zXFsHM= github.com/getsentry/sentry-go v0.9.0/go.mod h1:kELm/9iCblqUYh+ZRML7PNdCvEuw24wBvJPYyi86cws= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI= github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= @@ -255,7 +238,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -357,7 +339,6 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= @@ -410,9 +391,7 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -421,13 +400,11 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -446,7 +423,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -505,8 +481,6 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sethvargo/go-signalcontext v0.1.0 h1:3IU7HOlmRXF0PSDf85C4nJ/zjYDjF+DS+LufcKfLvyk= -github.com/sethvargo/go-signalcontext v0.1.0/go.mod h1:PXu9UmR2f7mmp8kEwgkKmaDbxq/PbqixkiC66WIkkWE= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -622,7 +596,6 @@ go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2Vm go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= -go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0 h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= @@ -640,7 +613,6 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0= go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= -go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= @@ -731,7 +703,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -859,7 +830,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.3 h1:hvZejVcIxAKHR8Pq2gXaDggf6CWT1QEqO+JEBeOKCG8= google.golang.org/appengine v1.6.3/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -906,7 +876,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -919,7 +888,6 @@ gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3M gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= @@ -937,9 +905,7 @@ gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/metrics/handler.go b/metrics/handler.go index 1fa4bb5b4..21a2a2007 100644 --- a/metrics/handler.go +++ b/metrics/handler.go @@ -12,11 +12,11 @@ import ( func (m *Metrics) ResourceMiddleware(cluster cluster.Cluster) func(http.Handler) http.Handler { return func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx, cancel := context.WithTimeout(context.Background(), m.Config.GlobalTimeout) + ctx, cancel := context.WithTimeout(context.TODO(), m.Config.GlobalTimeout) defer cancel() nodes, err := cluster.ListPodNodes(ctx, "", nil, true) if err != nil { - log.Errorf(context.TODO(), "[ResourceMiddleware] Get all nodes err %v", err) + log.Errorf(ctx, "[ResourceMiddleware] Get all nodes err %v", err) } for _, node := range nodes { m.SendNodeInfo(node.Metrics()) diff --git a/metrics/metrics.go b/metrics/metrics.go index 5688bfef1..55357c0a8 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -1,7 +1,6 @@ package metrics import ( - "context" "fmt" "os" @@ -48,9 +47,9 @@ func (m *Metrics) checkConn() error { // We needn't try to renew/reconnect because of only supporting UDP protocol now // We should add an `errorCount` to reconnect when implementing TCP protocol if m.statsdClient, err = statsdlib.New(m.StatsdAddr, statsdlib.WithErrorHandler(func(err error) { - log.Errorf(context.TODO(), "[statsd] Sending statsd failed: %v", err) + log.Errorf(nil, "[statsd] Sending statsd failed: %v", err) //nolint })); err != nil { - log.Errorf(context.TODO(), "[statsd] Connect statsd failed: %v", err) + log.Errorf(nil, "[statsd] Connect statsd failed: %v", err) //nolint return err } return nil @@ -115,7 +114,7 @@ func (m *Metrics) SendNodeInfo(nm *types.NodeMetrics) { } if err := m.gauge(fmt.Sprintf(cpuMap, cleanedNodeName, cpuid), val); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending cpu data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending cpu data to statsd: %v", err) //nolint } } @@ -124,23 +123,23 @@ func (m *Metrics) SendNodeInfo(nm *types.NodeMetrics) { } if err := m.gauge(fmt.Sprintf(memStats, cleanedNodeName), memory); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending memory data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending memory data to statsd: %v", err) //nolint } if err := m.gauge(fmt.Sprintf(storageStats, cleanedNodeName), storage); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending storage data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending storage data to statsd: %v", err) //nolint } if err := m.gauge(fmt.Sprintf(memUsedStats, cleanedNodeName), memoryUsed); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending memory used data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending memory used data to statsd: %v", err) //nolint } if err := m.gauge(fmt.Sprintf(storageUsedStats, cleanedNodeName), storageUsed); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending storage used data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending storage used data to statsd: %v", err) //nolint } if err := m.gauge(fmt.Sprintf(cpuUsedStats, cleanedNodeName), cpuUsed); err != nil { - log.Errorf(context.TODO(), "[SendNodeInfo] Error occurred while sending cpu used data to statsd: %v", err) + log.Errorf(nil, "[SendNodeInfo] Error occurred while sending cpu used data to statsd: %v", err) //nolint } } @@ -156,7 +155,7 @@ func (m *Metrics) SendDeployCount(n int) { } key := fmt.Sprintf(deployCount, m.Hostname) if err := m.count(key, n, 1.0); err != nil { - log.Errorf(context.TODO(), "[SendDeployCount] Error occurred while counting: %v", err) + log.Errorf(nil, "[SendDeployCount] Error occurred while counting: %v", err) //nolint } } diff --git a/rpc/rpc.go b/rpc/rpc.go index 1e26d59b1..570ff251a 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -866,7 +866,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error { if RunAndWaitOptions.AsyncTimeout != 0 { timeout = time.Second * time.Duration(RunAndWaitOptions.AsyncTimeout) } - ctx, cancel = context.WithTimeout(context.Background(), timeout) + ctx, cancel = context.WithTimeout(context.TODO(), timeout) // force mark stdin to false opts.OpenStdin = false } diff --git a/store/redis/ephemeral.go b/store/redis/ephemeral.go index 85d38a950..c9c4eb03c 100644 --- a/store/redis/ephemeral.go +++ b/store/redis/ephemeral.go @@ -58,7 +58,7 @@ func (r *Rediaron) revokeEphemeral(path string) { ctx, cancel := context.WithTimeout(context.TODO(), time.Second) defer cancel() if _, err := r.cli.Del(ctx, path).Result(); err != nil { - log.Errorf(context.TODO(), "[refreshEphemeral] revoke with %s failed: %v", path, err) + log.Errorf(nil, "[refreshEphemeral] revoke with %s failed: %v", path, err) //nolint } } diff --git a/utils/transaction.go b/utils/transaction.go index 49c06b98e..faf4c0059 100644 --- a/utils/transaction.go +++ b/utils/transaction.go @@ -31,7 +31,7 @@ func Txn(ctx context.Context, cond contextFunc, then contextFunc, rollback func( log.Warnf(ctx, "[txn] txn failed, rolling back: %v", txnErr) // forbid interrupting rollback - rollbackCtx, rollBackCancel := context.WithTimeout(InheritTracingInfo(ctx, context.Background()), ttl) + rollbackCtx, rollBackCancel := context.WithTimeout(InheritTracingInfo(ctx, context.TODO()), ttl) defer rollBackCancel() failureByCond := condErr != nil if err := rollback(rollbackCtx, failureByCond); err != nil { @@ -45,7 +45,7 @@ func Txn(ctx context.Context, cond contextFunc, then contextFunc, rollback func( thenCtx := txnCtx var thenCancel context.CancelFunc if rollback == nil { - thenCtx, thenCancel = context.WithTimeout(InheritTracingInfo(ctx, context.Background()), ttl) + thenCtx, thenCancel = context.WithTimeout(InheritTracingInfo(ctx, context.TODO()), ttl) defer thenCancel() } thenErr = then(thenCtx) diff --git a/wal/hydro.go b/wal/hydro.go index 9a7c63159..3bb20c8f5 100644 --- a/wal/hydro.go +++ b/wal/hydro.go @@ -49,7 +49,7 @@ func (h *Hydro) Recover(ctx context.Context) { for ent := range ch { ev, err := h.decodeEvent(ent) if err != nil { - log.Errorf(context.TODO(), "[Recover] decode event error: %v", err) + log.Errorf(nil, "[Recover] decode event error: %v", err) //nolint continue } events = append(events, ev) @@ -58,12 +58,12 @@ func (h *Hydro) Recover(ctx context.Context) { for _, ev := range events { handler, ok := h.getEventHandler(ev.Type) if !ok { - log.Errorf(context.TODO(), "[Recover] no such event handler for %s", ev.Type) + log.Errorf(nil, "[Recover] no such event handler for %s", ev.Type) //nolint continue } if err := h.recover(ctx, handler, ev); err != nil { - log.Errorf(context.TODO(), "[Recover] handle event %d (%s) failed: %v", ev.ID, ev.Type, err) + log.Errorf(nil, "[Recover] handle event %d (%s) failed: %v", ev.ID, ev.Type, err) //nolint continue } } diff --git a/wal/wal_test.go b/wal/wal_test.go index 1792b397a..3b284a472 100644 --- a/wal/wal_test.go +++ b/wal/wal_test.go @@ -38,7 +38,7 @@ func TestRecover(t *testing.T) { path := "/tmp/wal.unitest.wal" os.Remove(path) - wal WAL := NewHydro() + var wal WAL = NewHydro() require.NoError(t, wal.Open(path, time.Second)) defer wal.Close()