Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version to 1.22 #1861

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: true

env:
go_version: '1.21'
go_version: '1.22'

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/scylladb/scylla-operator-images:golang-1.21 AS builder
FROM quay.io/scylladb/scylla-operator-images:golang-1.22 AS builder
WORKDIR /go/src/github.com/scylladb/scylla-operator
COPY . .
RUN make build --warn-undefined-variables
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IMAGE_TAG ?= latest
IMAGE_REF ?= docker.io/scylladb/scylla-operator:$(IMAGE_TAG)

MAKE_REQUIRED_MIN_VERSION:=4.2 # for SHELLSTATUS
GO_REQUIRED_MIN_VERSION ?=1.21
GO_REQUIRED_MIN_VERSION ?=1.22

GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'v[0-9]*')$(if $(filter $(.SHELLSTATUS),0),,$(error git describe failed))
GIT_TAG_SHORT ?=$(shell git describe --tags --abbrev=7 --match 'v[0-9]*')$(if $(filter $(.SHELLSTATUS),0),,$(error git describe failed))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/scylladb/scylla-operator

go 1.21.8
go 1.22.1

require (
cloud.google.com/go/compute/metadata v0.2.3
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/scylla/validation/cluster_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,7 @@ func TestValidateScyllaCluster(t *testing.T) {
},
}

for i := range tests {
test := tests[i]

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 2 additions & 4 deletions pkg/api/scylla/validation/nodeconfig_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ func TestValidateNodeConfig(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -269,8 +268,7 @@ func TestValidateNodeConfigUpdate(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func IndentNext(spaceCount int, s string) string {
func Repeat(s string, count int) string {
var sb strings.Builder
sb.Grow(len(s) * count)
for i := 0; i < count; i++ {
for range count {
sb.WriteString(s)
}
return sb.String()
Expand Down
4 changes: 1 addition & 3 deletions pkg/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ func TestParseBearerAuth(t *testing.T) {
},
}

for i := range table {
test := table[i]

for _, test := range table {
t.Run(test.Name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/generateapireference/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func TestIndexNestedProps(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/operator/gather_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ metadata:
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/operator/mustgather_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ status: {}
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/operator/webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ func TestWebhookOptionsRun(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/releasenotes/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ func TestParsePullRequestNumber(t *testing.T) {
},
}

for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.Name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/releasenotes/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ func TestCleanupPRTitle(t *testing.T) {
},
}

for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.Name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/manager/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (c *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
9 changes: 3 additions & 6 deletions pkg/controller/manager/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,7 @@ func TestManagerSynchronization(t *testing.T) {
},
}

for i := range tcs {
test := tcs[i]
for _, test := range tcs {
t.Run(test.Name, func(t *testing.T) {
ctx := context.Background()
cluster := &scyllav1.ScyllaCluster{
Expand Down Expand Up @@ -496,8 +495,7 @@ func TestBackupTaskChanged(t *testing.T) {
},
}

for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -536,8 +534,7 @@ func TestRepairTaskChanged(t *testing.T) {
},
}

for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/manager/types_old_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func TestRepairTask_ToManager(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -209,7 +208,6 @@ func TestRepairTask_FromManager(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -303,7 +301,6 @@ func TestBackupTask_ToManager(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -395,7 +392,6 @@ func TestBackupTask_FromManager(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/nodeconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (ncc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/nodeconfigpod/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (ncpc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
6 changes: 2 additions & 4 deletions pkg/controller/nodetune/tune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func TestStripContainerID(t *testing.T) {
},
}

for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -185,8 +184,7 @@ func TestGetIRQCPUs(t *testing.T) {
expectedCpuSet: "0-5",
},
}
for i := range ts {
test := ts[i]
for _, test := range ts {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/orphanedpv/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (opc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
opc.wg.Add(1)
go func() {
defer opc.wg.Done()
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/scyllacluster/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (scc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
7 changes: 2 additions & 5 deletions pkg/controller/scyllacluster/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,6 @@ func TestStatefulSetForRack(t *testing.T) {
}

for _, tc := range tt {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2008,8 +2007,7 @@ func TestMakeIngresses(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2648,8 +2646,7 @@ func TestMakeJobs(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/scylladbmonitoring/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func (smc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/scyllaoperatorconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (opc *Controller) Run(ctx context.Context, workers int) {
return
}

for i := 0; i < workers; i++ {
for range workers {
opc.wg.Add(1)
go func() {
defer opc.wg.Done()
Expand Down
3 changes: 1 addition & 2 deletions pkg/controllerhelpers/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ func TestIsStatefulSetRolledOut(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
got, gotErr := IsStatefulSetRolledOut(tc.sts)
Expand Down
12 changes: 4 additions & 8 deletions pkg/controllerhelpers/scylla_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ func TestFindNodeConfigCondition(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -391,8 +390,7 @@ func TestGetScyllaHost(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -567,8 +565,7 @@ func TestGetScyllaNodeBroadcastAddress(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -756,8 +753,7 @@ func TestGetRequiredScyllaHosts(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions pkg/crypto/certcreators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ func TestX509CertCreator_MakeCertificate(t *testing.T) {
},
}
for _, tc := range tt {
tc := tc

t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 1 addition & 2 deletions pkg/disks/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ func TestGetBlockSize(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
3 changes: 1 addition & 2 deletions pkg/disks/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ func TestMakeFS(t *testing.T) {
},
}

for i := range tt {
tc := tt[i]
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading