Skip to content

Commit 4d91bc4

Browse files
authored
Update go version and FDB versions for e2e testing (FoundationDB#2194)
* Update go version and FDB versions for e2e testing * Revert go.mod go version to 1.22 * Fix linting issues with new golangci-lint version
1 parent 2dfd326 commit 4d91bc4

12 files changed

+25
-43
lines changed

.github/workflows/pull_request.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version: 1.22.10
21+
go-version: 1.23.5
2222
- name: Get dependencies
2323
run: curl -L --fail "https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb" -o fdb.deb
2424
- name: Install dependencies
@@ -42,7 +42,7 @@ jobs:
4242
- name: Set up Go
4343
uses: actions/setup-go@v4
4444
with:
45-
go-version: 1.22.10
45+
go-version: 1.23.5
4646
- name: Fetch all tags
4747
run: git fetch --force --tags
4848
- name: Get dependencies
@@ -103,7 +103,7 @@ jobs:
103103
- name: Set up Go
104104
uses: actions/setup-go@v4
105105
with:
106-
go-version: 1.22.10
106+
go-version: 1.23.5
107107
- name: Fetch all tags
108108
run: git fetch --force --tags
109109
- name: Get dependencies

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Go
4444
uses: actions/setup-go@v4
4545
with:
46-
go-version: 1.22.10
46+
go-version: 1.23.5
4747
# https://github.com/goreleaser/goreleaser/issues/1311
4848
- name: Get current semver tag
4949
run: echo "::set-output name=CURRENT_TAG::$(git describe --tags --match "v*" --abbrev=0)"

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ linters:
3939
- dogsled
4040
- errcheck
4141
- errorlint
42-
- exportloopref
42+
- copyloopvar
4343
# - goconst
4444
# - gocritic
4545
# - gocyclo

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG FDB_VERSION=6.2.29
22
ARG FDB_WEBSITE=https://github.com/apple/foundationdb/releases/download
33

44
# Build the manager binary
5-
FROM docker.io/library/golang:1.22.10 AS builder
5+
FROM docker.io/library/golang:1.23.5 AS builder
66

77
ARG FDB_VERSION
88
ARG FDB_WEBSITE

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CONTROLLER_GEN_PKG?=sigs.k8s.io/controller-tools/cmd/[email protected]
3333
CONTROLLER_GEN=$(GOBIN)/controller-gen
3434
KUSTOMIZE_PKG?=sigs.k8s.io/kustomize/kustomize/[email protected]
3535
KUSTOMIZE=$(GOBIN)/kustomize
36-
GOLANGCI_LINT_PKG=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
36+
GOLANGCI_LINT_PKG=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4
3737
GOLANGCI_LINT=$(GOBIN)/golangci-lint
3838
GORELEASER_PKG=github.com/goreleaser/[email protected]
3939
GORELEASER=$(GOBIN)/goreleaser

api/v1beta2/foundationdbcluster_types.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta2
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"k8s.io/apimachinery/pkg/util/intstr"
2223
"math"
@@ -2918,7 +2919,7 @@ func (cluster *FoundationDBCluster) Validate() error {
29182919
return nil
29192920
}
29202921

2921-
return fmt.Errorf(strings.Join(validations, ", "))
2922+
return errors.New(strings.Join(validations, ", "))
29222923
}
29232924

29242925
// IsTaintFeatureDisabled return true if operator is configured to not replace Pods tainted Nodes OR

e2e/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ TIMEOUT?=168h
1010
CLUSTER_NAME?=
1111
NAMESPACE?=
1212
CONTEXT?=
13-
FDB_VERSION?=7.1.63
13+
FDB_VERSION?=7.1.57
1414
# This will be the version used for upgrade tests.
15-
NEXT_FDB_VERSION?=7.3.43
15+
NEXT_FDB_VERSION?=7.3.59
1616
## Expectation is that you are running standard build image which generates both regular and debug (Symbols) images.
17-
FDB_IMAGE?=foundationdb/foundationdb:$(FDB_VERSION)
18-
UNIFIED_FDB_IMAGE?=foundationdb/fdb-kubernetes-monitor:$(FDB_VERSION)
19-
SIDECAR_IMAGE?=foundationdb/foundationdb-kubernetes-sidecar:$(FDB_VERSION)-1
17+
FDB_IMAGE?=foundationdb/foundationdb
18+
UNIFIED_FDB_IMAGE?=foundationdb/fdb-kubernetes-monitor
19+
SIDECAR_IMAGE?=foundationdb/foundationdb-kubernetes-sidecar
2020
OPERATOR_IMAGE?=foundationdb/fdb-kubernetes-operator:latest
2121
REGISTRY?=docker.io
2222
CLEANUP?=true

e2e/fixtures/cluster_config.go

-16
Original file line numberDiff line numberDiff line change
@@ -517,22 +517,6 @@ func (config *ClusterConfig) CalculateRoleCounts() fdbv1beta2.RoleCounts {
517517
return roleCounts
518518
}
519519

520-
func max(a int, b int) int {
521-
if a > b {
522-
return a
523-
}
524-
525-
return b
526-
}
527-
528-
func min(a int, b int) int {
529-
if a < b {
530-
return a
531-
}
532-
533-
return b
534-
}
535-
536520
func calculateProxies(proxies int) (int, int) {
537521
// This calculation is only a rough estimate and can change based on the workload.
538522
// Use 1/4 of the proxies for GRV or at max 4 processes

e2e/fixtures/status.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ func Unprintable(val string) ([]byte, error) {
487487
if c == '\\' {
488488
i++
489489
if i == len(val) {
490-
return nil, fmt.Errorf(fmt.Sprintf("end after one \\ when unprint [%s]", val))
490+
return nil, fmt.Errorf("end after one \\ when unprint [%s]", val)
491491
}
492492
switch val[i] {
493493
case '\\':
@@ -497,9 +497,7 @@ func Unprintable(val string) ([]byte, error) {
497497
case 'x':
498498
{
499499
if i+2 >= len(val) {
500-
return nil, fmt.Errorf(
501-
fmt.Sprintf("not have two chars after \\x when unprint [%s]", val),
502-
)
500+
return nil, fmt.Errorf("not have two chars after \\x when unprint [%s]", val)
503501
}
504502
d1, err := unhex(val[i+1])
505503
if err != nil {
@@ -514,9 +512,7 @@ func Unprintable(val string) ([]byte, error) {
514512
}
515513
default:
516514
{
517-
return nil, fmt.Errorf(
518-
fmt.Sprintf("after \\ it's neither \\ nor x when unprint %s", val),
519-
)
515+
return nil, fmt.Errorf("after \\ it's neither \\ nor x when unprint %s", val)
520516
}
521517
}
522518
} else {
@@ -538,5 +534,5 @@ func unhex(c byte) (int, error) {
538534
return int(c - 'A' + 10), nil
539535
}
540536

541-
return -1, fmt.Errorf(fmt.Sprintf("failed to unhex %x", c))
537+
return -1, fmt.Errorf("failed to unhex %x", c)
542538
}

kubectl-fdb/cmd/analyze.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package cmd
2222

2323
import (
2424
"encoding/json"
25+
"errors"
2526
"fmt"
2627
"strings"
2728
"time"
@@ -158,7 +159,7 @@ func newAnalyzeCmd(streams genericclioptions.IOStreams) *cobra.Command {
158159
errMsg.WriteString(err.Error())
159160
}
160161

161-
return fmt.Errorf(errMsg.String())
162+
return errors.New(errMsg.String())
162163
}
163164

164165
return nil
@@ -219,7 +220,7 @@ func allConditionsValid(conditions []string) error {
219220
return nil
220221
}
221222

222-
return fmt.Errorf(errString.String())
223+
return errors.New(errString.String())
223224
}
224225

225226
func analyzeCluster(cmd *cobra.Command, kubeClient client.Client, cluster *fdbv1beta2.FoundationDBCluster, autoFix bool, wait bool, ignoreConditions []string, ignoreRemovals bool) error {

kubectl-fdb/cmd/buggify_crash_loop.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func newBuggifyCrashLoop(streams genericclioptions.IOStreams) *cobra.Command {
4343
if err != nil {
4444
return err
4545
}
46-
clear, err := cmd.Flags().GetBool("clear")
46+
clearFlag, err := cmd.Flags().GetBool("clear")
4747
if err != nil {
4848
return err
4949
}
@@ -70,7 +70,7 @@ func newBuggifyCrashLoop(streams genericclioptions.IOStreams) *cobra.Command {
7070
buggifyProcessGroupOptions{
7171
containerName: containerName,
7272
wait: wait,
73-
clear: clear,
73+
clear: clearFlag,
7474
clean: clean,
7575
},
7676
processGroupSelectionOpts,

kubectl-fdb/cmd/buggify_no_schedule.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func newBuggifyNoSchedule(streams genericclioptions.IOStreams) *cobra.Command {
4242
if err != nil {
4343
return err
4444
}
45-
clear, err := cmd.Flags().GetBool("clear")
45+
clearFlag, err := cmd.Flags().GetBool("clear")
4646
if err != nil {
4747
return err
4848
}
@@ -64,7 +64,7 @@ func newBuggifyNoSchedule(streams genericclioptions.IOStreams) *cobra.Command {
6464
return updateNoScheduleList(cmd, kubeClient,
6565
buggifyProcessGroupOptions{
6666
wait: wait,
67-
clear: clear,
67+
clear: clearFlag,
6868
clean: clean,
6969
}, processGroupSelectionOpts)
7070
},

0 commit comments

Comments
 (0)