Skip to content

Commit bfcce5f

Browse files
committed
Bump go version to 1.24
1 parent 4f90210 commit bfcce5f

9 files changed

+13
-19
lines changed

api/v1beta1/gcpcluster_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"testing"
2221

2322
. "github.com/onsi/gomega"
@@ -90,7 +89,7 @@ func TestGCPCluster_ValidateUpdate(t *testing.T) {
9089
for _, test := range tests {
9190
t.Run(test.name, func(t *testing.T) {
9291
t.Parallel()
93-
warn, err := (&gcpClusterWebhook{}).ValidateUpdate(context.Background(), test.oldCluster, test.newCluster)
92+
warn, err := (&gcpClusterWebhook{}).ValidateUpdate(t.Context(), test.oldCluster, test.newCluster)
9493
if test.wantErr {
9594
g.Expect(err).To(HaveOccurred())
9695
} else {

api/v1beta1/gcpclustertemplate_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"testing"
2221

2322
. "github.com/onsi/gomega"
@@ -84,7 +83,7 @@ func TestGCPClusterTemplate_ValidateUpdate(t *testing.T) {
8483
for _, test := range tests {
8584
t.Run(test.name, func(t *testing.T) {
8685
t.Parallel()
87-
warn, err := (&gcpClusterTemplateWebhook{}).ValidateUpdate(context.Background(), test.oldTemplate, test.newTemplate)
86+
warn, err := (&gcpClusterTemplateWebhook{}).ValidateUpdate(t.Context(), test.oldTemplate, test.newTemplate)
8887
if test.wantErr {
8988
g.Expect(err).To(HaveOccurred())
9089
} else {

api/v1beta1/gcpmachine_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"testing"
2221

2322
. "github.com/onsi/gomega"
@@ -273,7 +272,7 @@ func TestGCPMachine_ValidateCreate(t *testing.T) {
273272
for _, test := range tests {
274273
t.Run(test.name, func(t *testing.T) {
275274
t.Parallel()
276-
warn, err := (&gcpMachineWebhook{}).ValidateCreate(context.Background(), test.GCPMachine)
275+
warn, err := (&gcpMachineWebhook{}).ValidateCreate(t.Context(), test.GCPMachine)
277276
if test.wantErr {
278277
g.Expect(err).To(HaveOccurred())
279278
} else {

api/v1beta1/gcpmachinetemplate_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"testing"
2221

2322
. "github.com/onsi/gomega"
@@ -233,7 +232,7 @@ func TestGCPMachineTemplate_ValidateCreate(t *testing.T) {
233232
for _, test := range tests {
234233
t.Run(test.name, func(t *testing.T) {
235234
t.Parallel()
236-
warn, err := (&gcpMachineTemplateWebhook{}).ValidateCreate(context.Background(), test.template)
235+
warn, err := (&gcpMachineTemplateWebhook{}).ValidateCreate(t.Context(), test.template)
237236
if test.wantErr {
238237
g.Expect(err).To(HaveOccurred())
239238
} else {

controllers/gcpcluster_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ limitations under the License.
1717
package controllers
1818

1919
import (
20+
"context"
21+
2022
. "github.com/onsi/ginkgo/v2"
2123
. "github.com/onsi/gomega"
22-
"golang.org/x/net/context"
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425
infrav1 "sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1"
2526
ctrl "sigs.k8s.io/controller-runtime"

exp/api/v1beta1/gcpmanagedcluster_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"testing"
2221

2322
. "github.com/onsi/gomega"
@@ -101,7 +100,7 @@ func TestGCPManagedClusterValidatingWebhookUpdate(t *testing.T) {
101100
},
102101
}
103102

104-
warn, err := (&gcpManagedClusterWebhook{}).ValidateUpdate(context.Background(), oldMC, newMC)
103+
warn, err := (&gcpManagedClusterWebhook{}).ValidateUpdate(t.Context(), oldMC, newMC)
105104

106105
if tc.expectError {
107106
g.Expect(err).To(HaveOccurred())

exp/api/v1beta1/gcpmanagedcontrolplane_webhook_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"strings"
2221
"testing"
2322

@@ -110,7 +109,7 @@ func TestGCPManagedControlPlaneDefaultingWebhook(t *testing.T) {
110109
},
111110
Spec: tc.spec,
112111
}
113-
err := (&gcpManagedControlPlaneWebhook{}).Default(context.Background(), mcp)
112+
err := (&gcpManagedControlPlaneWebhook{}).Default(t.Context(), mcp)
114113
g.Expect(err).NotTo(HaveOccurred())
115114

116115
g.Expect(mcp.Spec).ToNot(BeNil())
@@ -193,7 +192,7 @@ func TestGCPManagedControlPlaneValidatingWebhookCreate(t *testing.T) {
193192
mcp := &GCPManagedControlPlane{
194193
Spec: tc.spec,
195194
}
196-
warn, err := (&gcpManagedControlPlaneWebhook{}).ValidateCreate(context.Background(), mcp)
195+
warn, err := (&gcpManagedControlPlaneWebhook{}).ValidateCreate(t.Context(), mcp)
197196

198197
if tc.expectError {
199198
g.Expect(err).To(HaveOccurred())
@@ -288,7 +287,7 @@ func TestGCPManagedControlPlaneValidatingWebhookUpdate(t *testing.T) {
288287
},
289288
}
290289

291-
warn, err := (&gcpManagedControlPlaneWebhook{}).ValidateUpdate(context.Background(), oldMCP, newMCP)
290+
warn, err := (&gcpManagedControlPlaneWebhook{}).ValidateUpdate(t.Context(), oldMCP, newMCP)
292291

293292
if tc.expectError {
294293
g.Expect(err).To(HaveOccurred())

exp/api/v1beta1/gcpmanagedmachinepool_webhook_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"context"
2120
"strings"
2221
"testing"
2322

@@ -148,7 +147,7 @@ func TestGCPManagedMachinePoolValidatingWebhookCreate(t *testing.T) {
148147
mmp := &GCPManagedMachinePool{
149148
Spec: tc.spec,
150149
}
151-
warn, err := (&gcpManagedMachinePoolWebhook{}).ValidateCreate(context.Background(), mmp)
150+
warn, err := (&gcpManagedMachinePoolWebhook{}).ValidateCreate(t.Context(), mmp)
152151

153152
if tc.expectError {
154153
g.Expect(err).To(HaveOccurred())
@@ -215,7 +214,7 @@ func TestGCPManagedMachinePoolValidatingWebhookUpdate(t *testing.T) {
215214
},
216215
}
217216

218-
warn, err := (&gcpManagedMachinePoolWebhook{}).ValidateUpdate(context.Background(), oldMMP, newMMP)
217+
warn, err := (&gcpManagedMachinePoolWebhook{}).ValidateUpdate(t.Context(), oldMMP, newMMP)
219218

220219
if tc.expectError {
221220
g.Expect(err).To(HaveOccurred())

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module sigs.k8s.io/cluster-api-provider-gcp
22

3-
go 1.23.7
3+
go 1.24.6
44

55
require (
66
cloud.google.com/go/compute v1.44.0

0 commit comments

Comments
 (0)