From e95dce8ab1915240d870d386fc25dd2a75a74959 Mon Sep 17 00:00:00 2001 From: Yiran Wang Date: Tue, 5 May 2020 12:24:10 -0700 Subject: [PATCH] Migrate to Go 1.14 (#247) * Upgrade to go 1.14 * Migrate to go 1.14 * Fix authenticator --- .travis.yml | 5 +- Makefile | 4 +- examples/devcluster/README.md | 4 +- glide.lock | 463 ------------------ go.mod | 4 +- go.sum | 17 + .../registrybackend/security/security.go | 4 +- lib/torrent/scheduler/testutils_test.go | 2 +- 8 files changed, 26 insertions(+), 477 deletions(-) delete mode 100644 glide.lock diff --git a/.travis.yml b/.travis.yml index 0f8f57314..25c2ac9c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,13 @@ sudo: required language: go go: - - 1.12.x + - 1.14.x services: - docker env: - PATH=$HOME/protoc/bin:$PATH - - GO111MODULE=on before_script: - "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash" @@ -27,7 +26,7 @@ jobs: - stage: Compliance name: Fossa Check script: - - "GO111MODULE=on fossa --option allow-unresolved:true" + - "fossa --option allow-unresolved:true" after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/Makefile b/Makefile index 28cf44d8a..161e6dd29 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -export GO111MODULE = on - SHELL = /bin/bash -o pipefail GO = go @@ -25,7 +23,7 @@ BUILD_LINUX = GOOS=linux GOARCH=amd64 $(GO) build -i -o $@ $(BUILD_FLAGS) $(BUIL # Cross compiling cgo for sqlite3 is not well supported in Mac OSX. # This workaround builds the binary inside a linux container. -CROSS_COMPILER = docker run --rm -it -v $(shell go env GOPATH):/go -e GO111MODULE=on -w /go/src/github.com/uber/kraken golang:1.11.4 go build -o ./$@ ./$(dir $@) +CROSS_COMPILER = docker run --rm -it -v $(shell pwd):/go/src/github.com/uber/kraken -w /go/src/github.com/uber/kraken golang:1.14 go build -o ./$@ ./$(dir $@) LINUX_BINS = \ agent/agent \ diff --git a/examples/devcluster/README.md b/examples/devcluster/README.md index f2f168d5a..23f74b1a7 100644 --- a/examples/devcluster/README.md +++ b/examples/devcluster/README.md @@ -2,7 +2,7 @@ `$ make devcluster` -This command creates a `kraken-agent` image containing an agent binary and a `kraken-herd` image containing build-index, origin, proxy, and tracker binaries. +This command creates a `kraken-agent` image containing an agent binary and a `kraken-herd` image containing build-index, origin, proxy, and tracker binaries. It starts 2 agent docker containers and 1 herd container. Docker-for-Mac is required for devcluster to work, because the development config files use host.docker.internal for address of all components. @@ -10,7 +10,7 @@ It starts 2 agent docker containers and 1 herd container. Docker-for-Mac is requ A simple registry storage backend is provided for read-only access to Docker registry. A library image can be pulled from agent. -`$ docker pull localhost:16000/library/golang:1.11` +`$ docker pull localhost:16000/library/golang:1.14` Note, this backend is used for all `library/.*` repositories. `library` is the default namespace for Docker Hub's standard public repositories. diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 5c9a79603..000000000 --- a/glide.lock +++ /dev/null @@ -1,463 +0,0 @@ -hash: 1c75c63dee3f083dd0b0b502f4f0caf9c6d9cbf504510db1b09151756378a33c -updated: 2019-07-24T17:42:46.606990809-07:00 -imports: -- name: cloud.google.com/go - version: cdaaf98f9226c39dc162b8e55083b2fbc67b4674 - subpackages: - - compute/metadata - - iam - - internal - - internal/optional - - internal/trace - - internal/version - - storage -- name: github.com/alecthomas/kingpin - version: 947dcec5ba9c011838740e680966fd7087a71d0d -- name: github.com/alecthomas/template - version: a0175ee3bccc567396460bf5acd36800cb10c49c - subpackages: - - parse -- name: github.com/alecthomas/units - version: 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a -- name: github.com/andres-erbsen/clock - version: 9e14626cd129ba01ccb6806bcca9d523e570aaf0 -- name: github.com/aws/aws-sdk-go - version: 77b6968988559d355ab953b6436eafe6a76e4a92 - subpackages: - - aws - - aws/awserr - - aws/awsutil - - aws/client - - aws/client/metadata - - aws/corehandlers - - aws/credentials - - aws/credentials/ec2rolecreds - - aws/credentials/endpointcreds - - aws/credentials/processcreds - - aws/credentials/stscreds - - aws/csm - - aws/defaults - - aws/ec2metadata - - aws/endpoints - - aws/request - - aws/session - - aws/signer/v4 - - internal/ini - - internal/s3err - - internal/sdkio - - internal/sdkrand - - internal/sdkuri - - internal/shareddefaults - - private/protocol - - private/protocol/eventstream - - private/protocol/eventstream/eventstreamapi - - private/protocol/json/jsonutil - - private/protocol/jsonrpc - - private/protocol/query - - private/protocol/query/queryutil - - private/protocol/rest - - private/protocol/restxml - - private/protocol/xml/xmlutil - - service/ecr - - service/s3 - - service/s3/s3iface - - service/s3/s3manager - - service/sts - - service/sts/stsiface -- name: github.com/awslabs/amazon-ecr-credential-helper - version: b4a1707cec17b0533a5b9e9004ef4b59bcd0ca95 - subpackages: - - ecr-login - - ecr-login/api - - ecr-login/cache - - ecr-login/config - - ecr-login/version -- name: github.com/beorn7/perks - version: 3a771d992973f24aa725d07868b467d1ddfceafb - subpackages: - - quantile -- name: github.com/bshuster-repo/logrus-logstash-hook - version: 1e961e8e173c48bdddbf90e4fc4df8eaf8a7e918 -- name: github.com/bugsnag/bugsnag-go - version: d5b63da7e1f93d83e3980e5ab2bf33179bad7b2a - subpackages: - - device - - errors - - headers - - sessions -- name: github.com/bugsnag/panicwrap - version: 1d162ee1264c75b29b0f7733221bedfae7559079 -- name: github.com/c2h5oh/datasize - version: 4eba002a5eaea69cf8d235a388fc6b65ae68d2dd -- name: github.com/cactus/go-statsd-client - version: 138b925ccdf617776955904ba7759fce64406cec - subpackages: - - statsd -- name: github.com/cenkalti/backoff - version: 5267b6dd4d2666b980a911bf235efa276222cbe2 -- name: github.com/docker/distribution - version: 2461543d988979529609e8cb6fca9ca190dc48da - subpackages: - - configuration - - context - - digestset - - health - - health/checks - - manifest - - manifest/manifestlist - - manifest/ocischema - - manifest/schema1 - - manifest/schema2 - - metrics - - notifications - - reference - - registry - - registry/api/errcode - - registry/api/v2 - - registry/auth - - registry/client - - registry/client/auth - - registry/client/auth/challenge - - registry/client/transport - - registry/handlers - - registry/listener - - registry/middleware/registry - - registry/middleware/repository - - registry/proxy - - registry/proxy/scheduler - - registry/storage - - registry/storage/cache - - registry/storage/cache/memory - - registry/storage/cache/redis - - registry/storage/driver - - registry/storage/driver/factory - - registry/storage/driver/middleware - - uuid - - version -- name: github.com/docker/docker-credential-helpers - version: 54f0238b6bf101fc3ad3b34114cb5520beb562f5 - subpackages: - - client - - credentials -- name: github.com/docker/engine-api - version: 4290f40c056686fcaa5c9caf02eac1dde9315adf - subpackages: - - types - - types/blkiodev - - types/container - - types/filters - - types/mount - - types/network - - types/registry - - types/strslice - - types/swarm - - types/versions -- name: github.com/docker/go-connections - version: 97c2040d34dfae1d1b1275fa3a78dbdd2f41cf7e - subpackages: - - nat -- name: github.com/docker/go-metrics - version: b84716841b82eab644a0c64fc8b42d480e49add5 -- name: github.com/docker/go-units - version: 2fb04c6466a548a03cb009c5569ee1ab1e35398e -- name: github.com/docker/libtrust - version: aabc10ec26b754e797f9028f4589c5b7bd90dc20 -- name: github.com/garyburd/redigo - version: a69d19351219b6dd56f274f96d85a7014a2ec34e - subpackages: - - internal - - redis -- name: github.com/go-chi/chi - version: d0891661345200ebf8b816cc7de785e9bd570647 -- name: github.com/gofrs/uuid - version: 2593f3d8aa45b432942fe24758a279312d0f8719 -- name: github.com/golang/mock - version: 9fa652df1129bef0e734c9cf9bf6dbae9ef3b9fa - subpackages: - - gomock -- name: github.com/golang/protobuf - version: 6c65a5562fc06764971b7c5d05c76c75e84bdbf7 - subpackages: - - proto - - protoc-gen-go/descriptor - - ptypes - - ptypes/any - - ptypes/duration - - ptypes/timestamp -- name: github.com/googleapis/gax-go - version: bd5b16380fd03dc758d11cef74ba2e3bc8b0e8c2 - subpackages: - - v2 -- name: github.com/gorilla/handlers - version: ac6d24f88de4584385a0cb3a88f953d08a2f7a05 -- name: github.com/gorilla/mux - version: 00bdffe0f3c77e27d2cf6f5c70232a2d3e4d9c15 -- name: github.com/hashicorp/golang-lru - version: 7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c - subpackages: - - simplelru -- name: github.com/inconshreveable/mousetrap - version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -- name: github.com/jackpal/bencode-go - version: 227668e840fa94fd54b85018c733f73e73e06879 -- name: github.com/jmespath/go-jmespath - version: c2b33e8439af944379acbdd9c3a5fe0bc44bd8a5 -- name: github.com/jmoiron/sqlx - version: cdf62fdf55f66fb2484fe214f89c059f0bd3f567 - subpackages: - - reflectx -- name: github.com/jpillora/backoff - version: 3050d21c67d7c46b07ca1b5e1be0b26669c8d04c -- name: github.com/kardianos/osext - version: 2bc1f35cddc0cc527b4bc3dce8578fc2a6c11384 -- name: github.com/konsorten/go-windows-terminal-sequences - version: f55edac94c9bbba5d6182a4be46d86a2c9b5b50e -- name: github.com/mattn/go-sqlite3 - version: 31f5bb843b7852e28d5a66d1d539c042c3bb623a -- name: github.com/matttproud/golang_protobuf_extensions - version: c182affec369e30f25d3eb8cd8a478dee585ae7d - subpackages: - - pbutil -- name: github.com/mitchellh/go-homedir - version: af06845cf3004701891bf4fdb884bfe4920b3727 -- name: github.com/opencontainers/go-digest - version: ac19fd6e7483ff933754af248d80be865e543d22 -- name: github.com/opencontainers/image-spec - version: da296dcb1e473a9b4e2d148941d7faa9ac8fea3f - subpackages: - - specs-go - - specs-go/v1 -- name: github.com/pkg/errors - version: 27936f6d90f9c8e1145f11ed52ffffbfdb9e0af7 -- name: github.com/pressly/chi - version: da24bba8dcd4021cafac38724bf10dccc97c3e36 - subpackages: - - middleware -- name: github.com/pressly/goose - version: e4b98955473e91a12fc7d8816c28d06376d1d92c -- name: github.com/prometheus/client_golang - version: 7490f0a74525a1f863eaf81b42f3ead3a1ecc43a - subpackages: - - prometheus - - prometheus/internal - - prometheus/promhttp -- name: github.com/prometheus/client_model - version: fd36f4220a901265f90734c3183c5f0c91daa0b8 - subpackages: - - go -- name: github.com/prometheus/common - version: 3a34257982869c0624da7d3ec18755eb081df04f - subpackages: - - expfmt - - internal/bitbucket.org/ww/goautoneg - - model -- name: github.com/prometheus/procfs - version: af7bedc223fba51343f25a6fa7aba84355d0357a -- name: github.com/satori/go.uuid - version: f58768cc1a7a7e77a3bd49e98cdd21419399b6a3 -- name: github.com/Shopify/logrus-bugsnag - version: 577dee27f20dd8f1a529f82210094af593be12bd -- name: github.com/sirupsen/logrus - version: 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f -- name: github.com/spaolacci/murmur3 - version: 9f5d223c60793748f04a9d5b4b4eacddfc1f755d -- name: github.com/spf13/cobra - version: 67fc4837d267bc9bfd6e47f77783fcc3dffc68de -- name: github.com/spf13/pflag - version: 24fa6976df40757dce6aea913e7b81ade90530e1 -- name: github.com/uber-go/tally - version: f266f90e9c4d5894364039a324a05d061f2f34e2 - subpackages: - - m3 - - m3/customtransports - - m3/thrift - - m3/thriftudp - - statsd - - thirdparty/github.com/apache/thrift/lib/go/thrift -- name: github.com/willf/bitset - version: 18bd95f470f9494ca07c36d877424729edc2455c -- name: github.com/xenolf/lego - version: 5d557fdc6d9ee2226c0cce65733ee686ad4bc8b1 - subpackages: - - acme -- name: github.com/yvasiyarov/go-metrics - version: c25f46c4b94079672242ec48a545e7ca9ebe3aec -- name: github.com/yvasiyarov/gorelic - version: 635ca6035f2355e29fc558effa613d0d5867aac8 -- name: github.com/yvasiyarov/newrelic_platform_go - version: 9c099fbc30e90de5bb5c5f94aa5fd08f2daeaacd -- name: go.opencensus.io - version: a092815c29e3a8fb79dfa966ad048ed20f1f8c01 - subpackages: - - internal - - internal/tagencoding - - metric/metricdata - - metric/metricproducer - - plugin/ochttp - - plugin/ochttp/propagation/b3 - - resource - - stats - - stats/internal - - stats/view - - tag - - trace - - trace/internal - - trace/propagation - - trace/tracestate -- name: go.uber.org/atomic - version: df976f2515e274675050de7b3f42545de80594fd -- name: go.uber.org/multierr - version: 3c4937480c32f4c13a875a1829af76c98ca3d40a -- name: go.uber.org/zap - version: badef736563f8135e0add3232b06f58656da03c8 - subpackages: - - buffer - - internal/bufferpool - - internal/color - - internal/exit - - zapcore -- name: golang.org/x/crypto - version: 5295e8364332db77d75fce11f1d19c053919a9c9 - subpackages: - - ssh -- name: golang.org/x/net - version: 74de082e2cca95839e88aa0aeee5aadf6ce7710f - subpackages: - - context - - context/ctxhttp - - http/httpguts - - http2 - - http2/hpack - - idna - - internal/timeseries - - trace -- name: golang.org/x/oauth2 - version: 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33 - subpackages: - - google - - internal - - jws - - jwt -- name: golang.org/x/sync - version: e225da77a7e68af35c70ccbf71af2b83e6acac3c - subpackages: - - syncmap -- name: golang.org/x/sys - version: baf5eb976a8cd65845293cd814ea151018552292 - subpackages: - - unix -- name: golang.org/x/text - version: 342b2e1fbaa52c93f31447ad2c6abc048c63e475 - subpackages: - - secure/bidirule - - transform - - unicode/bidi - - unicode/norm -- name: golang.org/x/time - version: 9d24e82272b4f38b78bc8cff74fa936d31ccd8ef - subpackages: - - rate -- name: google.golang.org/api - version: 02490b97dff7cfde1995bd77de808fd27053bc87 - subpackages: - - gensupport - - googleapi - - googleapi/internal/uritemplates - - googleapi/transport - - internal - - iterator - - option - - storage/v1 - - transport/http - - transport/http/internal/propagation -- name: google.golang.org/appengine - version: b2f4a3cf3c67576a2ee09e1fe62656a5086ce880 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: google.golang.org/genproto - version: eb0b1bdb6ae60fcfc41b8d907b50dfb346112301 - subpackages: - - googleapis/api/annotations - - googleapis/iam/v1 - - googleapis/rpc/code - - googleapis/rpc/status - - googleapis/type/expr -- name: google.golang.org/grpc - version: b681a11d086e32e91ee8e61afc22a2c3c7870aba - subpackages: - - balancer - - balancer/base - - balancer/roundrobin - - binarylog/grpc_binarylog_v1 - - codes - - connectivity - - credentials - - credentials/internal - - encoding - - encoding/proto - - grpclog - - internal - - internal/backoff - - internal/balancerload - - internal/binarylog - - internal/channelz - - internal/envconfig - - internal/grpcrand - - internal/grpcsync - - internal/syscall - - internal/transport - - keepalive - - metadata - - naming - - peer - - resolver - - resolver/dns - - resolver/passthrough - - serviceconfig - - stats - - status - - tap -- name: gopkg.in/validator.v2 - version: 135c24b11c19e52befcae2ec3fca5d9b78c4e98e -- name: gopkg.in/yaml.v2 - version: 51d6538a90f86fe93ac480b35f37b2be17fef232 -- name: rsc.io/letsencrypt - version: 800d85d42bc784015c7189f6fad2d342ad65dd99 -testImports: -- name: github.com/alicebob/gopher-json - version: 5a6b3ba71ee69b77cf64febf8b5a7526ca5eaef0 -- name: github.com/alicebob/miniredis - version: 9615c6402328d2b1ae8a19f18adab10fa8c25f04 - subpackages: - - server -- name: github.com/davecgh/go-spew - version: d8f796af33cc11cb798c1aaeb27a4ebc5099927d - subpackages: - - spew -- name: github.com/gomodule/redigo - version: 39e2c31b7ca38b521ceb836620a269e62c895dc9 - subpackages: - - redis -- name: github.com/pmezard/go-difflib - version: 5d4384ee4fb2527b0a1256a821ebfc92f91efefc - subpackages: - - difflib -- name: github.com/stretchr/testify - version: ffdc059bfe9ce6a4e144ba849dbedead332c6053 - subpackages: - - assert - - require -- name: github.com/yuin/gopher-lua - version: 8bfc7677f583b35a5663a9dd934c08f3b5774bbb - subpackages: - - ast - - parse - - pm diff --git a/go.mod b/go.mod index 6e5e862a3..70358387f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/uber/kraken -go 1.12 +go 1.14 require ( cloud.google.com/go v0.43.0 @@ -26,7 +26,7 @@ require ( github.com/go-chi/chi v0.0.0-20190316151245-d08916613452 // indirect github.com/gofrs/uuid v0.0.0-20190320161447-2593f3d8aa45 // indirect github.com/golang/mock v1.3.1 - github.com/golang/protobuf v1.3.2 + github.com/golang/protobuf v1.4.0 github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/gorilla/handlers v0.0.0-20190227193432-ac6d24f88de4 // indirect github.com/gorilla/mux v1.7.3 diff --git a/go.sum b/go.sum index fda1ff6f2..f112094b0 100644 --- a/go.sum +++ b/go.sum @@ -105,6 +105,12 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -112,6 +118,9 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -316,6 +325,8 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0 h1:9sdfJOzWlkqPltHAuzT2Cp+yrBeY1KRVYgms8soxMwM= @@ -338,6 +349,12 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789 h1:NMiUjDZiD6qDVeBOzpImftxXzQHCp2Y2QLdmaqU9MRk= diff --git a/lib/backend/registrybackend/security/security.go b/lib/backend/registrybackend/security/security.go index 0fcd6fccb..bbdd79d98 100644 --- a/lib/backend/registrybackend/security/security.go +++ b/lib/backend/registrybackend/security/security.go @@ -73,13 +73,11 @@ type authenticator struct { // token based authentication challenges. If TLS is disabled, no authentication // is attempted. func NewAuthenticator(address string, config Config) (Authenticator, error) { + rt := http.DefaultTransport.(*http.Transport).Clone() tlsClientConfig, err := config.TLS.BuildClient() if err != nil { return nil, fmt.Errorf("build tls config for %q: %s", address, err) } - // TODO: Rather than mutating the global default, we should Clone() the - // default http transport once project upgrades to go >= 1.13 - rt := http.DefaultTransport.(*http.Transport) rt.TLSClientConfig = tlsClientConfig return &authenticator{ address: address, diff --git a/lib/torrent/scheduler/testutils_test.go b/lib/torrent/scheduler/testutils_test.go index 4bf8e48ff..343dc53f6 100644 --- a/lib/torrent/scheduler/testutils_test.go +++ b/lib/torrent/scheduler/testutils_test.go @@ -50,7 +50,7 @@ import ( const testTempDir = "/tmp/kraken_scheduler" -func init() { +func Init() { os.Mkdir(testTempDir, 0775) debug := flag.Bool("scheduler.debug", false, "log all Scheduler debugging output")