Skip to content

Commit 10c8070

Browse files
committed
fixup! build: Revert language compatibility to 1.23
1 parent 43f6780 commit 10c8070

File tree

13 files changed

+26
-17
lines changed

13 files changed

+26
-17
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ run:
55
timeout: 10m
66
build-tags:
77
- e2e
8+
go: "1.23"
89

910
linters:
1011
disable-all: true

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api
55

6-
go 1.24
6+
go 1.23
77

88
toolchain go1.24.1
99

common/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common
55

6-
go 1.24
6+
go 1.23
77

88
toolchain go1.24.1
99

common/pkg/capi/clustertopology/handlers/lifecycle/parallel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func Test_runHooksInParallel(t *testing.T) {
248248

249249
gotResponse := &runtimehooksv1.BeforeClusterUpgradeResponse{}
250250
runHooksInParallel(
251-
t.Context(),
251+
context.Background(),
252252
hookFuncs,
253253
&runtimehooksv1.BeforeClusterUpgradeRequest{},
254254
gotResponse,

common/pkg/capi/clustertopology/handlers/mutation/meta_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func TestMetaGeneratePatches(t *testing.T) {
223223
h := NewMetaGeneratePatchesHandler("", nil, tt.mutaters...).(GeneratePatches)
224224

225225
resp := &runtimehooksv1.GeneratePatchesResponse{}
226-
h.GeneratePatches(t.Context(), &runtimehooksv1.GeneratePatchesRequest{
226+
h.GeneratePatches(context.Background(), &runtimehooksv1.GeneratePatchesRequest{
227227
Items: []runtimehooksv1.GeneratePatchesRequestItem{
228228
request.NewKubeadmConfigTemplateRequestItem("kubeadm-config"),
229229
request.NewKubeadmControlPlaneTemplateRequestItem("kubeadm-control-plane"),

common/pkg/testutils/capitest/variables.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package capitest
55

66
import (
7+
"context"
78
"encoding/json"
89
"testing"
910

@@ -40,7 +41,7 @@ func ValidateDiscoverVariables[T mutation.DiscoverVariables](
4041
h := handlerCreator()
4142
resp := &runtimehooksv1.DiscoverVariablesResponse{}
4243
h.DiscoverVariables(
43-
t.Context(),
44+
context.Background(),
4445
&runtimehooksv1.DiscoverVariablesRequest{},
4546
resp,
4647
)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix
55

6-
go 1.24
6+
go 1.23
77

88
toolchain go1.24.1
99

pkg/handlers/generic/lifecycle/csi/handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func Test_AfterControlPlaneInitialized(t *testing.T) {
155155
}
156156
for _, tt := range tests {
157157
t.Run(tt.name, func(t *testing.T) {
158-
ctx := t.Context()
158+
ctx := context.Background()
159159
client := fake.NewClientBuilder().Build()
160160
handler := New(client, testProviderHandlers)
161161
resp := &runtimehooksv1.AfterControlPlaneInitializedResponse{}

pkg/handlers/generic/lifecycle/servicelbgc/deleter_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package servicelbgc
55

66
import (
7+
"context"
78
"testing"
89

910
"github.com/go-logr/logr"
@@ -203,13 +204,17 @@ func Test_deleteServicesWithLoadBalancer(t *testing.T) {
203204
svc := &tt.startServices[i]
204205
require.NoError(
205206
t,
206-
fakeClient.Create(t.Context(), svc),
207+
fakeClient.Create(context.Background(), svc),
207208
"error creating Service",
208209
)
209210
}
210211

211212
for {
212-
err := deleteServicesWithLoadBalancer(t.Context(), fakeClient, logr.Discard())
213+
err := deleteServicesWithLoadBalancer(
214+
context.Background(),
215+
fakeClient,
216+
logr.Discard(),
217+
)
213218
if err == nil {
214219
break
215220
}
@@ -224,7 +229,7 @@ func Test_deleteServicesWithLoadBalancer(t *testing.T) {
224229
services := &corev1.ServiceList{}
225230
require.NoError(
226231
t,
227-
fakeClient.List(t.Context(), services),
232+
fakeClient.List(context.Background(), services),
228233
"error listing Services",
229234
)
230235
assert.Equal(t, tt.endServices, services.Items)

pkg/handlers/generic/lifecycle/serviceloadbalancer/handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func testCases(t *testing.T) []testCase {
124124
func TestAfterControlPlaneInitialized(t *testing.T) {
125125
for _, tt := range testCases(t) {
126126
t.Run(tt.name, func(t *testing.T) {
127-
ctx := t.Context()
127+
ctx := context.Background()
128128
client := fake.NewClientBuilder().Build()
129129
handler := New(client, testProviderHandlers)
130130
resp := &runtimehooksv1.AfterControlPlaneInitializedResponse{}
@@ -156,7 +156,7 @@ func TestAfterControlPlaneInitialized(t *testing.T) {
156156
func TestBeforeClusterUpgrade(t *testing.T) {
157157
for _, tt := range testCases(t) {
158158
t.Run(tt.name, func(t *testing.T) {
159-
ctx := t.Context()
159+
ctx := context.Background()
160160
client := fake.NewClientBuilder().Build()
161161
handler := New(client, testProviderHandlers)
162162
resp := &runtimehooksv1.BeforeClusterUpgradeResponse{}

pkg/handlers/generic/mutation/controlplanevirtualip/providers/kubevip_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package providers
55

66
import (
7+
"context"
78
"testing"
89

910
"github.com/stretchr/testify/assert"
@@ -191,7 +192,7 @@ func Test_GenerateFilesAndCommands(t *testing.T) {
191192
}
192193

193194
files, preKubeadmCommands, postKubeadmCommands, err := provider.GenerateFilesAndCommands(
194-
t.Context(),
195+
context.Background(),
195196
tt.controlPlaneEndpointSpec,
196197
tt.cluster,
197198
)
@@ -271,7 +272,7 @@ func Test_getTemplateFromConfigMap(t *testing.T) {
271272
fakeClient := fake.NewClientBuilder().WithObjects(tt.configMap).Build()
272273

273274
data, err := getTemplateFromConfigMap(
274-
t.Context(),
275+
context.Background(),
275276
fakeClient,
276277
client.ObjectKeyFromObject(tt.configMap),
277278
)

pkg/handlers/utils/secrets_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package utils
55

66
import (
7+
"context"
78
"fmt"
89
"testing"
910

@@ -114,7 +115,7 @@ func Test_EnsureOwnerReferenceForSecret(t *testing.T) {
114115
t.Parallel()
115116

116117
err := EnsureClusterOwnerReferenceForObject(
117-
t.Context(),
118+
context.Background(),
118119
tt.client,
119120
corev1.TypedLocalObjectReference{
120121
Kind: "Secret",
@@ -133,7 +134,7 @@ func Test_EnsureOwnerReferenceForSecret(t *testing.T) {
133134
// verify that the owner reference was added
134135
secret := &corev1.Secret{}
135136
err = tt.client.Get(
136-
t.Context(),
137+
context.Background(),
137138
client.ObjectKey{Namespace: tt.cluster.Namespace, Name: tt.secretName},
138139
secret,
139140
)

pkg/wait/wait_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func TestWait(t *testing.T) {
166166
for _, tt := range tests {
167167
t.Run(tt.name, func(t *testing.T) {
168168
err := ForObject(
169-
t.Context(),
169+
context.Background(),
170170
tt.input,
171171
)
172172
if !tt.errCheck(err) {

0 commit comments

Comments
 (0)