From d6ce747efb035a9c73392428cdef3d4eada0ef1d Mon Sep 17 00:00:00 2001 From: secwall Date: Wed, 6 Dec 2023 12:48:41 +0100 Subject: [PATCH 1/2] Bump go version to 1.21 (#60) --- .github/workflows/docker-jepsen.yml | 2 +- .github/workflows/docker-tests-8.0.yml | 2 +- .github/workflows/docker-tests.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- go.mod | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-jepsen.yml b/.github/workflows/docker-jepsen.yml index 94f161b0..33e02075 100644 --- a/.github/workflows/docker-jepsen.yml +++ b/.github/workflows/docker-jepsen.yml @@ -5,7 +5,7 @@ on: - cron: '0 0 * * *' env: - GO_VERSION: 1.20.5 + GO_VERSION: 1.21.3 jobs: test: diff --git a/.github/workflows/docker-tests-8.0.yml b/.github/workflows/docker-tests-8.0.yml index 1dc20e6d..c5dedb38 100644 --- a/.github/workflows/docker-tests-8.0.yml +++ b/.github/workflows/docker-tests-8.0.yml @@ -7,7 +7,7 @@ on: branches: [ master ] env: - GO_VERSION: 1.20.5 + GO_VERSION: 1.21.3 jobs: buildimages: diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml index 4786da12..eff58baf 100644 --- a/.github/workflows/docker-tests.yml +++ b/.github/workflows/docker-tests.yml @@ -7,7 +7,7 @@ on: branches: [ master ] env: - GO_VERSION: 1.20.5 + GO_VERSION: 1.21.3 jobs: buildimages: diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 548defc4..eedffe8d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.5 + go-version: 1.21.3 - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0e33c503..43191724 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ on: branches: [ master ] env: - GO_VERSION: 1.20.5 + GO_VERSION: 1.21.3 jobs: unittest: diff --git a/go.mod b/go.mod index 26a51205..0d993151 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/yandex/mysync -go 1.18 +go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 From 4754a37430bea8f8b22b8ec6f8d7ec4da52657f4 Mon Sep 17 00:00:00 2001 From: secwall Date: Wed, 6 Dec 2023 15:50:08 +0100 Subject: [PATCH 2/2] Bump github.com/docker/docker (#61) --- Makefile | 2 +- go.mod | 3 +-- go.sum | 7 ++----- tests/testutil/docker_composer.go | 7 +++---- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index cd44feaa..606b6e49 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ format: goimports -w `find . -name '*.go'` lint: - docker run --rm -v ${CURDIR}:/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v + docker run --rm -v ${CURDIR}:/app -w /app golangci/golangci-lint:v1.55 golangci-lint run -v unittests: go test ./cmd/... ./internal/... diff --git a/go.mod b/go.mod index 0d993151..bd2314ea 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/cucumber/godog v0.13.0 - github.com/docker/docker v20.10.24+incompatible + github.com/docker/docker v24.0.7+incompatible github.com/go-mysql-org/go-mysql v1.7.0 github.com/go-sql-driver/mysql v1.7.1 github.com/go-zookeeper/zk v1.0.3 @@ -49,7 +49,6 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 // indirect github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 // indirect - github.com/sirupsen/logrus v1.7.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect diff --git a/go.sum b/go.sum index 11d9b99e..85d28ea2 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= -github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -246,8 +246,6 @@ github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBf github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 h1:oI+RNwuC9jF2g2lP0u0cVEEZrc/AYBCuFdvwrLWM/6Q= github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07/go.mod h1:yFdBgwXP24JziuRl2NMUahT7nGLNOKi1SIiFxMttVD4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= @@ -342,7 +340,6 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/tests/testutil/docker_composer.go b/tests/testutil/docker_composer.go index 5c05d224..4c418f6b 100644 --- a/tests/testutil/docker_composer.go +++ b/tests/testutil/docker_composer.go @@ -15,12 +15,12 @@ import ( "time" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" ) const defaultDockerTimeout = 30 * time.Second const defaultDockerComposeTimeout = 90 * time.Second -const defaultContainerStopTimeout = 30 * time.Second const shell = "/bin/bash" // Composer manipulate images/vm's during integration tests @@ -286,7 +286,7 @@ func (dc *DockerComposer) Start(service string) error { } ctx, cancel := context.WithTimeout(context.Background(), defaultDockerTimeout) defer cancel() - err := dc.api.ContainerRestart(ctx, cont.ID, nil) + err := dc.api.ContainerRestart(ctx, cont.ID, container.StopOptions{}) if err != nil { return err } @@ -303,8 +303,7 @@ func (dc *DockerComposer) Stop(service string) error { } ctx, cancel := context.WithTimeout(context.Background(), defaultDockerTimeout) defer cancel() - stopTimeout := defaultContainerStopTimeout - err := dc.api.ContainerStop(ctx, cont.ID, &stopTimeout) + err := dc.api.ContainerStop(ctx, cont.ID, container.StopOptions{}) dc.stopped[service] = true return err }