Skip to content

Commit

Permalink
Migrate to Go 1.14 (#247)
Browse files Browse the repository at this point in the history
* Upgrade to go 1.14

* Migrate to go 1.14

* Fix authenticator
Yiran Wang authored May 5, 2020
1 parent e8b9a9f commit e95dce8
Showing 8 changed files with 26 additions and 477 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 \
4 changes: 2 additions & 2 deletions examples/devcluster/README.md
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@

`$ 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.

## 2. Pulling from Docker Hub Library

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.

463 changes: 0 additions & 463 deletions glide.lock

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -105,13 +105,22 @@ 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=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
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=
4 changes: 1 addition & 3 deletions lib/backend/registrybackend/security/security.go
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion lib/torrent/scheduler/testutils_test.go
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit e95dce8

Please sign in to comment.