Skip to content

[WIP] Bump CAPI to v1.11.0-alpha.1 #5661

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
./hack/create-custom-cloud-provider-config.sh

# Deploy CAPI
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.2/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.0-alpha.1/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"

# Deploy CAAPH
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/download/v0.2.5/addon-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ settings = {
"deploy_cert_manager": True,
"preload_images_for_kind": True,
"kind_cluster_name": "capz",
"capi_version": "v1.10.2",
"capi_version": "v1.11.0-alpha.1",
"caaph_version": "v0.2.5",
"cert_manager_version": "v1.17.2",
"kubernetes_version": "v1.32.2",
Expand Down 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
Loading
Loading