Skip to content

Bump Go toolchain to v1.24.6 #5813

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ARG ARCH

# Build the manager binary
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def validate_auth():

tilt_helper_dockerfile_header = """
# Tilt image
FROM golang:1.23 AS tilt-helper
FROM golang:1.24 AS tilt-helper
# Support live reloading with Tilt
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/start.sh && \
Expand Down
5 changes: 2 additions & 3 deletions api/v1beta1/azurecluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -109,7 +108,7 @@ func TestAzureCluster_ValidateCreate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := (&AzureClusterWebhook{}).ValidateCreate(context.Background(), tc.cluster)
_, err := (&AzureClusterWebhook{}).ValidateCreate(t.Context(), tc.cluster)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -345,7 +344,7 @@ func TestAzureCluster_ValidateUpdate(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
_, err := (&AzureClusterWebhook{}).ValidateUpdate(context.Background(), tc.oldCluster, tc.cluster)
_, err := (&AzureClusterWebhook{}).ValidateUpdate(t.Context(), tc.oldCluster, tc.cluster)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
5 changes: 2 additions & 3 deletions api/v1beta1/azureclusteridentity_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -84,7 +83,7 @@ func TestAzureClusterIdentity_ValidateCreate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := (&azureClusterIdentityWebhook{}).ValidateCreate(context.Background(), tc.clusterIdentity)
_, err := (&azureClusterIdentityWebhook{}).ValidateCreate(t.Context(), tc.clusterIdentity)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -164,7 +163,7 @@ func TestAzureClusterIdentity_ValidateUpdate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := (&azureClusterIdentityWebhook{}).ValidateUpdate(context.Background(), tc.oldClusterIdentity, tc.clusterIdentity)
_, err := (&azureClusterIdentityWebhook{}).ValidateUpdate(t.Context(), tc.oldClusterIdentity, tc.clusterIdentity)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
3 changes: 1 addition & 2 deletions api/v1beta1/azureclustertemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -58,7 +57,7 @@ func TestValidateUpdate(t *testing.T) {

t.Run("template is immutable", func(t *testing.T) {
g := NewWithT(t)
_, err := (&azureClusterTemplateWebhook{}).ValidateUpdate(context.Background(), oldClusterTemplate, newClusterTemplate)
_, err := (&azureClusterTemplateWebhook{}).ValidateUpdate(t.Context(), oldClusterTemplate, newClusterTemplate)
g.Expect(err).To(HaveOccurred())
})
}
10 changes: 5 additions & 5 deletions api/v1beta1/azuremachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestAzureMachine_ValidateCreate(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
mw := &azureMachineWebhook{}
_, err := mw.ValidateCreate(context.Background(), tc.machine)
_, err := mw.ValidateCreate(t.Context(), tc.machine)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -928,7 +928,7 @@ func TestAzureMachine_ValidateUpdate(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
mw := &azureMachineWebhook{}
_, err := mw.ValidateUpdate(context.Background(), tc.oldMachine, tc.newMachine)
_, err := mw.ValidateUpdate(t.Context(), tc.oldMachine, tc.newMachine)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -980,17 +980,17 @@ func TestAzureMachine_Default(t *testing.T) {
Client: mockClient,
}

err := mw.Default(context.Background(), publicKeyExistTest.machine)
err := mw.Default(t.Context(), publicKeyExistTest.machine)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(publicKeyExistTest.machine.Spec.SSHPublicKey).To(Equal(existingPublicKey))

err = mw.Default(context.Background(), publicKeyNotExistTest.machine)
err = mw.Default(t.Context(), publicKeyNotExistTest.machine)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(publicKeyNotExistTest.machine.Spec.SSHPublicKey).To(Not(BeEmpty()))

for _, possibleCachingType := range armcompute.PossibleCachingTypesValues() {
cacheTypeSpecifiedTest := test{machine: &AzureMachine{ObjectMeta: testObjectMeta, Spec: AzureMachineSpec{OSDisk: OSDisk{CachingType: string(possibleCachingType)}}}}
err = mw.Default(context.Background(), cacheTypeSpecifiedTest.machine)
err = mw.Default(t.Context(), cacheTypeSpecifiedTest.machine)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(cacheTypeSpecifiedTest.machine.Spec.OSDisk.CachingType).To(Equal(string(possibleCachingType)))
}
Expand Down
7 changes: 3 additions & 4 deletions api/v1beta1/azuremachinetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
Expand Down Expand Up @@ -248,7 +247,7 @@ func TestAzureMachineTemplate_ValidateCreate(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
ctx := context.Background()
ctx := t.Context()
_, err := (&azureMachineTemplateWebhook{}).ValidateCreate(ctx, test.machineTemplate)
if test.wantErr {
g.Expect(err).To(HaveOccurred())
Expand Down Expand Up @@ -547,7 +546,7 @@ func TestAzureMachineTemplate_ValidateUpdate(t *testing.T) {
for _, amt := range tests {
t.Run(amt.name, func(t *testing.T) {
g := NewWithT(t)
ctx := admission.NewContextWithRequest(context.Background(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{DryRun: ptr.To(true)}})
ctx := admission.NewContextWithRequest(t.Context(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{DryRun: ptr.To(true)}})
_, err := (&azureMachineTemplateWebhook{}).ValidateUpdate(ctx, amt.oldTemplate, amt.template)
if amt.wantErr {
g.Expect(err).To(HaveOccurred())
Expand All @@ -561,7 +560,7 @@ func TestAzureMachineTemplate_ValidateUpdate(t *testing.T) {
t.Run(amt.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
ctx := admission.NewContextWithRequest(context.Background(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{DryRun: ptr.To(false)}})
ctx := admission.NewContextWithRequest(t.Context(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{DryRun: ptr.To(false)}})
_, err := (&azureMachineTemplateWebhook{}).ValidateUpdate(ctx, amt.oldTemplate, amt.template)
if amt.wantErr {
g.Expect(err).To(HaveOccurred())
Expand Down
7 changes: 3 additions & 4 deletions api/v1beta1/azuremanagedcluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -82,7 +81,7 @@ func TestAzureManagedCluster_ValidateUpdate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := (&azureManagedClusterWebhook{}).ValidateUpdate(context.Background(), tc.oldAMC, tc.amc)
_, err := (&azureManagedClusterWebhook{}).ValidateUpdate(t.Context(), tc.oldAMC, tc.amc)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -125,7 +124,7 @@ func TestAzureManagedCluster_ValidateCreate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := (&azureManagedClusterWebhook{}).ValidateCreate(context.Background(), tc.amc)
_, err := (&azureManagedClusterWebhook{}).ValidateCreate(t.Context(), tc.amc)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -155,7 +154,7 @@ func TestAzureManagedCluster_ValidateCreateFailure(t *testing.T) {
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, *tc.featureGateEnabled)
}
g := NewWithT(t)
_, err := (&azureManagedClusterWebhook{}).ValidateCreate(context.Background(), tc.amc)
_, err := (&azureManagedClusterWebhook{}).ValidateCreate(t.Context(), tc.amc)
if tc.expectError {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
21 changes: 10 additions & 11 deletions api/v1beta1/azuremanagedcontrolplane_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -61,7 +60,7 @@ func TestDefaultingWebhook(t *testing.T) {
},
}
mcpw := &azureManagedControlPlaneWebhook{}
err := mcpw.Default(context.Background(), amcp)
err := mcpw.Default(t.Context(), amcp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(amcp.Spec.ResourceGroupName).To(Equal("fooCluster"))
g.Expect(amcp.Spec.Version).To(Equal("v1.17.5"))
Expand Down Expand Up @@ -104,7 +103,7 @@ func TestDefaultingWebhook(t *testing.T) {
}
amcp.Spec.EnablePreviewFeatures = ptr.To(true)

err = mcpw.Default(context.Background(), amcp)
err = mcpw.Default(t.Context(), amcp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*amcp.Spec.NetworkPlugin).To(Equal(netPlug))
g.Expect(*amcp.Spec.NetworkPolicy).To(Equal(netPol))
Expand Down Expand Up @@ -160,7 +159,7 @@ func TestDefaultingWebhook(t *testing.T) {
SSHPublicKey: ptr.To(""),
},
}
err = mcpw.Default(context.Background(), amcp)
err = mcpw.Default(t.Context(), amcp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(amcp.Spec.VirtualNetwork.CIDRBlock).To(Equal(defaultAKSVnetCIDRForOverlay))
g.Expect(amcp.Spec.VirtualNetwork.Subnet.CIDRBlock).To(Equal(defaultAKSNodeSubnetCIDRForOverlay))
Expand Down Expand Up @@ -1387,7 +1386,7 @@ func TestValidatingWebhook(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateCreate(context.Background(), &tt.amcp)
_, err := mcpw.ValidateCreate(t.Context(), &tt.amcp)
if tt.expectErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -1637,7 +1636,7 @@ func TestAzureManagedControlPlane_ValidateCreate(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateCreate(context.Background(), tc.amcp)
_, err := mcpw.ValidateCreate(t.Context(), tc.amcp)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
if tc.errorLen > 0 {
Expand Down Expand Up @@ -1674,7 +1673,7 @@ func TestAzureManagedControlPlane_ValidateCreateFailure(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateCreate(context.Background(), tc.amcp)
_, err := mcpw.ValidateCreate(t.Context(), tc.amcp)
if tc.expectError {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -3184,7 +3183,7 @@ func TestAzureManagedControlPlane_ValidateUpdate(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateUpdate(context.Background(), tc.oldAMCP, tc.amcp)
_, err := mcpw.ValidateUpdate(t.Context(), tc.oldAMCP, tc.amcp)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -3365,7 +3364,7 @@ func TestAzureManagedClusterSecurityProfileValidateCreate(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateCreate(context.Background(), tc.amcp)
_, err := mcpw.ValidateCreate(t.Context(), tc.amcp)
if tc.wantErr != "" {
g.Expect(err).To(HaveOccurred())
g.Expect(err.Error()).To(Equal(tc.wantErr))
Expand Down Expand Up @@ -3866,7 +3865,7 @@ func TestAzureClusterSecurityProfileValidateUpdate(t *testing.T) {
mcpw := &azureManagedControlPlaneWebhook{
Client: client,
}
_, err := mcpw.ValidateUpdate(context.Background(), tc.oldAMCP, tc.amcp)
_, err := mcpw.ValidateUpdate(t.Context(), tc.oldAMCP, tc.amcp)
if tc.wantErr != "" {
g.Expect(err).To(HaveOccurred())
g.Expect(err.Error()).To(Equal(tc.wantErr))
Expand Down Expand Up @@ -4154,7 +4153,7 @@ func TestValidateAMCPVirtualNetwork(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
mcpw := &azureManagedControlPlaneWebhook{}
err := mcpw.Default(context.Background(), tc.amcp)
err := mcpw.Default(t.Context(), tc.amcp)
g.Expect(err).NotTo(HaveOccurred())

errs := validateAMCPVirtualNetwork(tc.amcp.Spec.VirtualNetwork, field.NewPath("spec", "virtualNetwork"))
Expand Down
7 changes: 3 additions & 4 deletions api/v1beta1/azuremanagedcontrolplanetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand All @@ -31,7 +30,7 @@ func TestControlPlaneTemplateDefaultingWebhook(t *testing.T) {
t.Logf("Testing amcp defaulting webhook with no baseline")
amcpt := getAzureManagedControlPlaneTemplate()
mcptw := &azureManagedControlPlaneTemplateWebhook{}
err := mcptw.Default(context.Background(), amcpt)
err := mcptw.Default(t.Context(), amcpt)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*amcpt.Spec.Template.Spec.NetworkPlugin).To(Equal("azure"))
g.Expect(*amcpt.Spec.Template.Spec.LoadBalancerSKU).To(Equal("Standard"))
Expand All @@ -54,7 +53,7 @@ func TestControlPlaneTemplateDefaultingWebhook(t *testing.T) {
amcpt.Spec.Template.Spec.SKU.Tier = PaidManagedControlPlaneTier
amcpt.Spec.Template.Spec.EnablePreviewFeatures = ptr.To(true)

err = mcptw.Default(context.Background(), amcpt)
err = mcptw.Default(t.Context(), amcpt)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*amcpt.Spec.Template.Spec.NetworkPlugin).To(Equal(netPlug))
g.Expect(*amcpt.Spec.Template.Spec.LoadBalancerSKU).To(Equal(lbSKU))
Expand Down Expand Up @@ -274,7 +273,7 @@ func TestControlPlaneTemplateUpdateWebhook(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
cpw := &azureManagedControlPlaneTemplateWebhook{}
_, err := cpw.ValidateUpdate(context.Background(), tc.oldControlPlaneTemplate, tc.controlPlaneTemplate)
_, err := cpw.ValidateUpdate(t.Context(), tc.oldControlPlaneTemplate, tc.controlPlaneTemplate)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
15 changes: 7 additions & 8 deletions api/v1beta1/azuremanagedmachinepool_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001"
Expand Down Expand Up @@ -55,7 +54,7 @@ func TestAzureManagedMachinePoolDefaultingWebhook(t *testing.T) {
mw := &azureManagedMachinePoolWebhook{
Client: client,
}
err := mw.Default(context.Background(), ammp)
err := mw.Default(t.Context(), ammp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(ammp.Labels).NotTo(BeNil())
val, ok := ammp.Labels[LabelAgentPoolMode]
Expand All @@ -66,21 +65,21 @@ func TestAzureManagedMachinePoolDefaultingWebhook(t *testing.T) {
t.Logf("Testing ammp defaulting webhook with empty string name specified in Spec")
emptyName := ""
ammp.Spec.Name = &emptyName
err = mw.Default(context.Background(), ammp)
err = mw.Default(t.Context(), ammp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*ammp.Spec.Name).To(Equal("fooname"))

t.Logf("Testing ammp defaulting webhook with normal name specified in Spec")
normalName := "barname"
ammp.Spec.Name = &normalName
err = mw.Default(context.Background(), ammp)
err = mw.Default(t.Context(), ammp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*ammp.Spec.Name).To(Equal("barname"))

t.Logf("Testing ammp defaulting webhook with normal OsDiskType specified in Spec")
normalOsDiskType := "Ephemeral"
ammp.Spec.OsDiskType = &normalOsDiskType
err = mw.Default(context.Background(), ammp)
err = mw.Default(t.Context(), ammp)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(*ammp.Spec.OsDiskType).To(Equal("Ephemeral"))
}
Expand Down Expand Up @@ -642,7 +641,7 @@ func TestAzureManagedMachinePoolUpdatingWebhook(t *testing.T) {
mw := &azureManagedMachinePoolWebhook{
Client: client,
}
_, err := mw.ValidateUpdate(context.Background(), tc.old, tc.new)
_, err := mw.ValidateUpdate(t.Context(), tc.old, tc.new)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -1293,7 +1292,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
mw := &azureManagedMachinePoolWebhook{
Client: client,
}
_, err := mw.ValidateCreate(context.Background(), tc.ammp)
_, err := mw.ValidateCreate(t.Context(), tc.ammp)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
g.Expect(err).To(HaveLen(tc.errorLen))
Expand Down Expand Up @@ -1325,7 +1324,7 @@ func TestAzureManagedMachinePool_ValidateCreateFailure(t *testing.T) {
}
g := NewWithT(t)
mw := &azureManagedMachinePoolWebhook{}
_, err := mw.ValidateCreate(context.Background(), tc.ammp)
_, err := mw.ValidateCreate(t.Context(), tc.ammp)
if tc.expectError {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
Loading