Skip to content

Commit 96bc32f

Browse files
authored
Build using Go 1.25.0 (#791)
1 parent 5964dcf commit 96bc32f

21 files changed

+130
-103
lines changed

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.4
1+
1.25.0

.golangci.yml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
11
# options for analysis running
2+
version: "2"
3+
24
run:
35
# include test files or not, default is true
46
tests: true
57

8+
formatters:
9+
enable:
10+
- gofmt
11+
exclusions:
12+
generated: disable
13+
paths:
14+
- data/
15+
616
linters:
17+
settings:
18+
staticcheck:
19+
dot-import-whitelist:
20+
- github.com/onsi/gomeg
721
enable:
822
- asasalint
923
- asciicheck
1024
- bidichk
1125
- bodyclose
1226
- gocritic
13-
- gofmt
1427

15-
issues:
16-
# Excluding configuration per-path, per-linter, per-text and per-source
17-
exclude-rules:
18-
# Exclude some linters from running on data files.
19-
- path: pkg/data
20-
linters:
21-
- gofmt
22-
# Exclude some linters from running on tests files.
23-
- path: test\.go
24-
linters:
25-
- gosec
26-
- bodyclose
28+
exclusions:
29+
presets:
30+
- common-false-positives
31+
paths:
32+
- utils/docgen/main.go
33+
- utils/linkcheck/main.go
34+
rules:
35+
- path: _test\.go
36+
linters:
37+
- gosec
38+
- bodyclose
39+
- errcheck
40+
- path: test/
41+
linters:
42+
- staticcheck
43+
text: "ST1001:"
44+
- path: pkg/fakes/
45+
linters:
46+
- staticcheck
47+
text: "ST1001:"

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,7 @@ code-review: $(BUILD_TARGETS)/generate golangci copyright ## Full code review a
881881
# ----------------------------------------------------------------------------------------------------------------------
882882
.PHONY: golangci
883883
golangci: $(TOOLS_BIN)/golangci-lint ## Go code review
884-
$(TOOLS_BIN)/golangci-lint run -v --timeout=5m --exclude='G402:' --exclude='G101:' --exclude='G114:' --exclude-dirs=.*/fakes --exclude-files=zz_.*,generated/*,pkg/data/assets... ./api/... ./controllers/... ./pkg/... ./runner/...
885-
$(TOOLS_BIN)/golangci-lint run -v --timeout=5m --exclude='G107:' --exclude='G101:' --exclude='G112:' --exclude='SA4005:' --exclude='should not use dot imports' ./test/... ./pkg/fakes/...
884+
$(TOOLS_BIN)/golangci-lint run -v --timeout=5m
886885

887886

888887
# ----------------------------------------------------------------------------------------------------------------------
@@ -2969,7 +2968,7 @@ get-istio: $(BUILD_PROPS) $(BUILD_OUTPUT)/istio-config.yaml ## Download Istio to
29692968
# ----------------------------------------------------------------------------------------------------------------------
29702969
$(TOOLS_BIN)/golangci-lint:
29712970
@mkdir -p $(TOOLS_BIN)
2972-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh --header $(GH_AUTH) | sh -s -- -b $(TOOLS_BIN) v1.64.7
2971+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh --header $(GH_AUTH) | sh -s -- -b $(TOOLS_BIN) v2.4.0
29732972

29742973
# ----------------------------------------------------------------------------------------------------------------------
29752974
# Display the full version string for the artifacts that would be built.

api/v1/coherence_types.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import (
1111
"context"
1212
"encoding/json"
1313
"fmt"
14+
"os"
15+
"strconv"
16+
"strings"
17+
"time"
18+
1419
"github.com/go-logr/logr"
1520
"github.com/go-test/deep"
1621
"github.com/oracle/coherence-operator/pkg/operator"
@@ -26,13 +31,9 @@ import (
2631
"k8s.io/apimachinery/pkg/runtime/schema"
2732
"k8s.io/apimachinery/pkg/util/intstr"
2833
"k8s.io/utils/ptr"
29-
"os"
3034
"sigs.k8s.io/controller-runtime/pkg/client"
3135
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
3236
"sigs.k8s.io/controller-runtime/pkg/manager"
33-
"strconv"
34-
"strings"
35-
"time"
3637
)
3738

3839
// Common Coherence API structs
@@ -2985,7 +2986,7 @@ type Resources struct {
29852986

29862987
func (in Resources) MarshalJSON() ([]byte, error) {
29872988
buffer := bytes.NewBufferString("{")
2988-
buffer.WriteString(fmt.Sprintf(`"apiVersion":"%d"`, in.Version))
2989+
_, _ = fmt.Fprintf(buffer, `"apiVersion":"%d"`, in.Version)
29892990
buffer.WriteString(`, "kind": "Resources"`)
29902991
buffer.WriteString(`, "items":[`)
29912992

api/v1/coherence_webhook_job.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package v1
99
import (
1010
"context"
1111
"fmt"
12+
1213
batchv1 "k8s.io/api/batch/v1"
1314
corev1 "k8s.io/api/core/v1"
1415
apiequality "k8s.io/apimachinery/pkg/api/equality"
@@ -68,7 +69,7 @@ func (in *CoherenceJob) Default(_ context.Context, obj runtime.Object) error {
6869
}
6970

7071
// set the default replicas if not present
71-
if spec.CoherenceResourceSpec.Replicas == nil {
72+
if spec.Replicas == nil {
7273
spec.SetReplicas(spec.GetReplicas())
7374
}
7475

api/v1/coherencejobresource_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package v1
88

99
import (
1010
"fmt"
11+
1112
"github.com/oracle/coherence-operator/pkg/operator"
1213
"golang.org/x/mod/semver"
1314
batchv1 "k8s.io/api/batch/v1"
@@ -544,10 +545,10 @@ func (in *CoherenceJobResourceSpec) GetRestartPolicy() *corev1.RestartPolicy {
544545
// return either the actual Replica value or the default (DefaultReplicas const)
545546
// if the Replicas field is nil.
546547
func (in *CoherenceJobResourceSpec) GetReplicas() int32 {
547-
if in == nil || in.CoherenceResourceSpec.Replicas == nil {
548+
if in == nil || in.Replicas == nil {
548549
return DefaultJobReplicas
549550
}
550-
return *in.CoherenceResourceSpec.Replicas
551+
return *in.Replicas
551552
}
552553

553554
// GetWkaIPFamily returns the IP Family of the headless Service used for Coherence WKA.

api/v1/coherenceresource_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package v1
88

99
import (
1010
"fmt"
11+
1112
"github.com/oracle/coherence-operator/pkg/operator"
1213
"golang.org/x/mod/semver"
1314
appsv1 "k8s.io/api/apps/v1"
@@ -186,7 +187,7 @@ func (in *Coherence) GetReplicas() int32 {
186187
// SetReplicas sets the number of replicas required for a deployment.
187188
func (in *Coherence) SetReplicas(replicas int32) {
188189
if in != nil {
189-
in.Spec.CoherenceResourceSpec.Replicas = &replicas
190+
in.Spec.Replicas = &replicas
190191
}
191192
}
192193

controllers/job/job_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ package job
99
import (
1010
"context"
1111
"fmt"
12+
"time"
13+
1214
"github.com/go-logr/logr"
1315
coh "github.com/oracle/coherence-operator/api/v1"
1416
"github.com/oracle/coherence-operator/controllers/reconciler"
@@ -25,7 +27,6 @@ import (
2527
"sigs.k8s.io/controller-runtime/pkg/client"
2628
"sigs.k8s.io/controller-runtime/pkg/manager"
2729
"sigs.k8s.io/controller-runtime/pkg/reconcile"
28-
"time"
2930
)
3031

3132
const (
@@ -260,8 +261,8 @@ func (in *ReconcileJob) patchJob(ctx context.Context, deployment coh.CoherenceRe
260261
current := job.DeepCopy()
261262

262263
// We NEVER patch finalizers
263-
original.ObjectMeta.Finalizers = current.ObjectMeta.Finalizers
264-
desired.ObjectMeta.Finalizers = current.ObjectMeta.Finalizers
264+
original.Finalizers = current.Finalizers
265+
desired.Finalizers = current.Finalizers
265266

266267
// We need to ensure we do not create a patch due to differences in
267268
// Job Status, so we blank out the status fields

controllers/statefulset/statefulset_controller.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ package statefulset
99
import (
1010
"context"
1111
"fmt"
12+
"os"
13+
"strings"
14+
"time"
15+
1216
"github.com/go-logr/logr"
1317
coh "github.com/oracle/coherence-operator/api/v1"
1418
"github.com/oracle/coherence-operator/controllers/reconciler"
@@ -25,12 +29,9 @@ import (
2529
apierrors "k8s.io/apimachinery/pkg/api/errors"
2630
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2731
"k8s.io/utils/ptr"
28-
"os"
2932
logf "sigs.k8s.io/controller-runtime/pkg/log"
3033
"sigs.k8s.io/controller-runtime/pkg/manager"
3134
"sigs.k8s.io/controller-runtime/pkg/reconcile"
32-
"strings"
33-
"time"
3435
)
3536

3637
const (
@@ -455,8 +456,8 @@ func (in *ReconcileStatefulSet) maybePatchStatefulSet(ctx context.Context, deplo
455456
}
456457

457458
// We NEVER patch finalizers
458-
original.ObjectMeta.Finalizers = current.ObjectMeta.Finalizers
459-
desired.ObjectMeta.Finalizers = current.ObjectMeta.Finalizers
459+
original.Finalizers = current.Finalizers
460+
desired.Finalizers = current.Finalizers
460461

461462
// We need to ensure we do not create a patch due to differences in
462463
// StatefulSet Status, so we blank out the status fields

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module github.com/oracle/coherence-operator
88
// See ./.go-version for the go compiler version used when building binaries
99
//
1010
// https://go.dev/doc/modules/gomod-ref#go
11-
go 1.24.4
11+
go 1.25.0
1212

1313
require (
1414
github.com/distribution/reference v0.6.0

0 commit comments

Comments
 (0)