Skip to content

Commit

Permalink
[main] Upgrade the Golang version to go1.21.0 (vitessio#13853)
Browse files Browse the repository at this point in the history
Co-authored-by: frouioui <[email protected]>
Co-authored-by: Florent Poinsard <[email protected]>
  • Loading branch information
3 people authored and timvaillancourt committed Mar 18, 2024
1 parent 21c971d commit c5f38a9
Show file tree
Hide file tree
Showing 36 changed files with 59 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign_milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.4
go-version: 1.21.8

- name: Checkout code
uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
with:
go-version: 1.21.8

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18.16.0'

- name: Tune the OS
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/local_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
with:
go-version: 1.21.8

- uses: actions/setup-node@v3
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
with:
# node-version should match package.json
node-version: '18.16.0'

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/region_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
with:
go-version: 1.21.8

- uses: actions/setup-node@v3
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
with:
# node-version should match package.json
node-version: '18.16.0'

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.13
go-version: 1.21.8

- name: Tune the OS
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unit_test_mysql80.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jobs:
with:
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
uses: actions/setup-python@v4

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_golang_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20.2
go-version: 1.21.8

- name: Check out code
uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@v3
with:
go-version: 1.20.8
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ $(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto
# This rule builds the bootstrap images for all flavors.
DOCKER_IMAGES_FOR_TEST = mariadb mariadb103 mysql57 mysql80 percona57 percona80
DOCKER_IMAGES = common $(DOCKER_IMAGES_FOR_TEST)
BOOTSTRAP_VERSION=14.1
BOOTSTRAP_VERSION=21
ensure_bootstrap_version:
find docker/ -type f -exec sed -i "s/^\(ARG bootstrap_version\)=.*/\1=${BOOTSTRAP_VERSION}/" {} \;
sed -i 's/\(^.*flag.String(\"bootstrap-version\",\) *\"[^\"]\+\"/\1 \"${BOOTSTRAP_VERSION}\"/' test.go
Expand Down
2 changes: 1 addition & 1 deletion build.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
source ./tools/shell_functions.inc

go version >/dev/null 2>&1 || fail "Go is not installed or is not in \$PATH. See https://vitess.io/contributing/build-from-source for install instructions."
goversion_min 1.20.1 || fail "Go version reported: `go version`. Version 1.20.1+ required. See https://vitess.io/contributing/build-from-source for install instructions."
goversion_min 1.21.0 || echo "Go version reported: `go version`. Version 1.21.0+ recommended. See https://vitess.io/contributing/build-from-source for install instructions."

mkdir -p dist
mkdir -p bin
Expand Down
2 changes: 1 addition & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}"
Expand Down
2 changes: 1 addition & 1 deletion docker/base/Dockerfile.percona57
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona57"

FROM "${image}"
Expand Down
2 changes: 1 addition & 1 deletion docker/base/Dockerfile.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona80"

FROM "${image}"
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.percona57
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.testing
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi7.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi7.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi7.percona57
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi7.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-percona80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi8.arm64.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile.ubi8.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/local/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-common"

FROM "${image}"
Expand Down
2 changes: 1 addition & 1 deletion docker/vttestserver/Dockerfile.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql57"

FROM "${image}" AS builder
Expand Down
2 changes: 1 addition & 1 deletion docker/vttestserver/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ensure images contain the right binaries.

# Use a temporary layer for the build stage.
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"

FROM "${image}" AS builder
Expand Down
5 changes: 3 additions & 2 deletions go/vt/tlstest/tlstest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func testClientServer(t *testing.T, combineCerts bool) {
// With TLS 1.3, the Dial will succeed and the first Read will fail.
clientConn, err := tls.DialWithDialer(dialer, "tcp", addr, badClientConfig)
if err != nil {
if !strings.Contains(err.Error(), "bad certificate") {
if !strings.Contains(err.Error(), "certificate required") {
t.Errorf("Wrong error returned: %v", err)
}
return
Expand All @@ -177,7 +177,8 @@ func testClientServer(t *testing.T, combineCerts bool) {
if err == nil {
t.Fatalf("Dial or first Read was expected to fail")
}
if !strings.Contains(err.Error(), "bad certificate") {

if !strings.Contains(err.Error(), "certificate required") {
t.Errorf("Wrong error returned: %v", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ For example:
// Flags
var (
flavor = flag.String("flavor", "mysql57", "comma-separated bootstrap flavor(s) to run against (when using Docker mode). Available flavors: all,"+flavors)
bootstrapVersion = flag.String("bootstrap-version", "14.1", "the version identifier to use for the docker images")
bootstrapVersion = flag.String("bootstrap-version", "21", "the version identifier to use for the docker images")
runCount = flag.Int("runs", 1, "run each test this many times")
retryMax = flag.Int("retry", 3, "max number of retries, to detect flaky tests")
logPass = flag.Bool("log-pass", false, "log test output even if it passes")
Expand Down
2 changes: 1 addition & 1 deletion test/templates/dockerfile.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG bootstrap_version=14.1
ARG bootstrap_version=21
ARG image="vitess/bootstrap:${bootstrap_version}-{{.Platform}}"

FROM "${image}"
Expand Down
5 changes: 5 additions & 0 deletions test/templates/unit_test.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
with:
go-version: 1.21.8

- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
uses: actions/setup-python@v4
>>>>>>> 0ac8cd4d4e ([main] Upgrade the Golang version to `go1.21.0` (#13853))

- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
run: |
Expand Down

0 comments on commit c5f38a9

Please sign in to comment.