Skip to content

Commit bd64ba3

Browse files
committed
Bump CAPI to v1.10.0-beta.0
1 parent 9736fb5 commit bd64ba3

File tree

32 files changed

+325
-277
lines changed

32 files changed

+325
-277
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ ifneq ($(abspath $(ROOT_DIR)),$(GOPATH)/src/sigs.k8s.io/cluster-api-provider-azu
7070
endif
7171

7272
# Binaries.
73-
CONTROLLER_GEN_VER := v0.16.1
73+
CONTROLLER_GEN_VER := v0.17.2
7474
CONTROLLER_GEN_BIN := controller-gen
7575
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
7676

77-
CONVERSION_GEN_VER := v0.31.0
77+
CONVERSION_GEN_VER := v0.32.2
7878
CONVERSION_GEN_BIN := conversion-gen
7979
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)
8080

@@ -86,7 +86,7 @@ GOLANGCI_LINT_VER := $(shell cat .github/workflows/pr-golangci-lint.yaml | grep
8686
GOLANGCI_LINT_BIN := golangci-lint
8787
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
8888

89-
KUSTOMIZE_VER := v5.4.1
89+
KUSTOMIZE_VER := v5.6.0
9090
KUSTOMIZE_BIN := kustomize
9191
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
9292

@@ -135,7 +135,7 @@ CODESPELL_BIN := codespell
135135
CODESPELL_DIST_DIR := codespell_dist
136136
CODESPELL := $(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR)/$(CODESPELL_BIN)
137137

138-
SETUP_ENVTEST_VER := release-0.19
138+
SETUP_ENVTEST_VER := release-0.20
139139
SETUP_ENVTEST_BIN := setup-envtest
140140
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
141141
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
@@ -328,7 +328,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
328328
./hack/create-custom-cloud-provider-config.sh
329329

330330
# Deploy CAPI
331-
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.5/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
331+
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.0-beta.0/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
332332

333333
# Deploy CAAPH
334334
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"

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ settings = {
2222
"deploy_cert_manager": True,
2323
"preload_images_for_kind": True,
2424
"kind_cluster_name": "capz",
25-
"capi_version": "v1.9.5",
25+
"capi_version": "v1.10.0-beta.0",
2626
"caaph_version": "v0.2.5",
2727
"cert_manager_version": "v1.16.2",
2828
"kubernetes_version": "v1.30.2",

api/v1beta1/azurecluster_webhook.go

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

1919
import (
20+
"context"
2021
"reflect"
2122

2223
apierrors "k8s.io/apimachinery/pkg/api/errors"
2324
"k8s.io/apimachinery/pkg/runtime"
2425
"k8s.io/apimachinery/pkg/util/validation/field"
2526
ctrl "sigs.k8s.io/controller-runtime"
26-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2727
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2828

2929
webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook"
@@ -33,27 +33,27 @@ import (
3333
func (c *AzureCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
3434
return ctrl.NewWebhookManagedBy(mgr).
3535
For(c).
36+
WithDefaulter(&AzureCluster{}).
37+
WithValidator(&AzureCluster{}).
3638
Complete()
3739
}
3840

3941
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=validation.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4042
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=default.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4143

42-
var _ webhook.Validator = &AzureCluster{}
43-
var _ webhook.Defaulter = &AzureCluster{}
44-
4544
// Default implements webhook.Defaulter so a webhook will be registered for the type.
46-
func (c *AzureCluster) Default() {
45+
func (c *AzureCluster) Default(ctx context.Context, obj runtime.Object) error {
4746
c.setDefaults()
47+
return nil
4848
}
4949

5050
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
51-
func (c *AzureCluster) ValidateCreate() (admission.Warnings, error) {
51+
func (c *AzureCluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
5252
return c.validateCluster(nil)
5353
}
5454

5555
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
56-
func (c *AzureCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
56+
func (c *AzureCluster) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
5757
var allErrs field.ErrorList
5858
old := oldRaw.(*AzureCluster)
5959

@@ -196,6 +196,6 @@ func (c *AzureCluster) validateSubnetUpdate(old *AzureCluster) field.ErrorList {
196196
}
197197

198198
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
199-
func (c *AzureCluster) ValidateDelete() (admission.Warnings, error) {
199+
func (c *AzureCluster) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
200200
return nil, nil
201201
}

api/v1beta1/azureclusteridentity_webhook.go

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

1919
import (
20+
"context"
21+
2022
apierrors "k8s.io/apimachinery/pkg/api/errors"
2123
"k8s.io/apimachinery/pkg/runtime"
2224
"k8s.io/apimachinery/pkg/util/validation/field"
2325
ctrl "sigs.k8s.io/controller-runtime"
24-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2526
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2627

2728
webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook"
@@ -31,20 +32,19 @@ import (
3132
func (c *AzureClusterIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error {
3233
return ctrl.NewWebhookManagedBy(mgr).
3334
For(c).
35+
WithValidator(&AzureClusterIdentity{}).
3436
Complete()
3537
}
3638

3739
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities,versions=v1beta1,name=validation.azureclusteridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3840

39-
var _ webhook.Validator = &AzureClusterIdentity{}
40-
4141
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
42-
func (c *AzureClusterIdentity) ValidateCreate() (admission.Warnings, error) {
42+
func (c *AzureClusterIdentity) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
4343
return c.validateClusterIdentity()
4444
}
4545

4646
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
47-
func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
47+
func (c *AzureClusterIdentity) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
4848
var allErrs field.ErrorList
4949
old := oldRaw.(*AzureClusterIdentity)
5050
if err := webhookutils.ValidateImmutable(
@@ -60,6 +60,6 @@ func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.
6060
}
6161

6262
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
63-
func (c *AzureClusterIdentity) ValidateDelete() (admission.Warnings, error) {
63+
func (c *AzureClusterIdentity) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
6464
return nil, nil
6565
}

api/v1beta1/azureclustertemplate_webhook.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"context"
2021
"reflect"
2122

2223
apierrors "k8s.io/apimachinery/pkg/api/errors"
2324
"k8s.io/apimachinery/pkg/runtime"
2425
"k8s.io/apimachinery/pkg/util/validation/field"
2526
ctrl "sigs.k8s.io/controller-runtime"
26-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2727
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2828
)
2929

@@ -34,28 +34,27 @@ const AzureClusterTemplateImmutableMsg = "AzureClusterTemplate spec.template.spe
3434
func (c *AzureClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
3535
return ctrl.NewWebhookManagedBy(mgr).
3636
For(c).
37+
WithDefaulter(&AzureClusterTemplate{}).
38+
WithValidator(&AzureClusterTemplate{}).
3739
Complete()
3840
}
3941

4042
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=validation.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4143
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=default.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
4244

43-
var _ webhook.Defaulter = &AzureClusterTemplate{}
44-
4545
// Default implements webhook.Defaulter so a webhook will be registered for the type.
46-
func (c *AzureClusterTemplate) Default() {
46+
func (c *AzureClusterTemplate) Default(ctx context.Context, obj runtime.Object) error {
4747
c.setDefaults()
48+
return nil
4849
}
4950

50-
var _ webhook.Validator = &AzureClusterTemplate{}
51-
5251
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
53-
func (c *AzureClusterTemplate) ValidateCreate() (admission.Warnings, error) {
52+
func (c *AzureClusterTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
5453
return c.validateClusterTemplate()
5554
}
5655

5756
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
58-
func (c *AzureClusterTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
57+
func (c *AzureClusterTemplate) ValidateUpdate(ctx context.Context, obj runtime.Object, oldRaw runtime.Object) (admission.Warnings, error) {
5958
var allErrs field.ErrorList
6059
old := oldRaw.(*AzureClusterTemplate)
6160
if !reflect.DeepEqual(c.Spec.Template.Spec, old.Spec.Template.Spec) {
@@ -71,6 +70,6 @@ func (c *AzureClusterTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.
7170
}
7271

7372
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
74-
func (c *AzureClusterTemplate) ValidateDelete() (admission.Warnings, error) {
73+
func (c *AzureClusterTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
7574
return nil, nil
7675
}

api/v1beta1/azuremanagedcluster_webhook.go

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

1919
import (
20+
"context"
21+
2022
"k8s.io/apimachinery/pkg/runtime"
2123
ctrl "sigs.k8s.io/controller-runtime"
22-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2324
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2425
)
2526

2627
// SetupWebhookWithManager sets up and registers the webhook with the manager.
2728
func (r *AzureManagedCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
2829
return ctrl.NewWebhookManagedBy(mgr).
2930
For(r).
31+
WithValidator(&AzureManagedCluster{}).
3032
Complete()
3133
}
3234

3335
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclusters,versions=v1beta1,name=validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3436

35-
var _ webhook.Validator = &AzureManagedCluster{}
36-
3737
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
38-
func (r *AzureManagedCluster) ValidateCreate() (admission.Warnings, error) {
38+
func (r *AzureManagedCluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
3939
return nil, nil
4040
}
4141

4242
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
43-
func (r *AzureManagedCluster) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
43+
func (r *AzureManagedCluster) ValidateUpdate(ctx context.Context, obj runtime.Object, _ runtime.Object) (admission.Warnings, error) {
4444
return nil, nil
4545
}
4646

4747
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
48-
func (r *AzureManagedCluster) ValidateDelete() (admission.Warnings, error) {
48+
func (r *AzureManagedCluster) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
4949
return nil, nil
5050
}

api/v1beta1/azuremanagedclustertemplate_webhook.go

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

1919
import (
20+
"context"
21+
2022
"k8s.io/apimachinery/pkg/runtime"
2123
ctrl "sigs.k8s.io/controller-runtime"
22-
"sigs.k8s.io/controller-runtime/pkg/webhook"
2324
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2425
)
2526

2627
// SetupWebhookWithManager sets up and registers the webhook with the manager.
2728
func (r *AzureManagedClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
2829
return ctrl.NewWebhookManagedBy(mgr).
2930
For(r).
31+
WithValidator(&AzureManagedClusterTemplate{}).
3032
Complete()
3133
}
3234

3335
// +kubebuilder:webhook:verbs=update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedclustertemplate,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclustertemplates,versions=v1beta1,name=validation.azuremanagedclustertemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
3436

35-
var _ webhook.Validator = &AzureManagedClusterTemplate{}
36-
3737
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
38-
func (r *AzureManagedClusterTemplate) ValidateCreate() (admission.Warnings, error) {
38+
func (r *AzureManagedClusterTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
3939
return nil, nil
4040
}
4141

4242
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
43-
func (r *AzureManagedClusterTemplate) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
43+
func (r *AzureManagedClusterTemplate) ValidateUpdate(ctx context.Context, obj runtime.Object, _ runtime.Object) (admission.Warnings, error) {
4444
return nil, nil
4545
}
4646

4747
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
48-
func (r *AzureManagedClusterTemplate) ValidateDelete() (admission.Warnings, error) {
48+
func (r *AzureManagedClusterTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
4949
return nil, nil
5050
}

config/crd/bases/infrastructure.cluster.x-k8s.io_azureasomanagedclusters.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: azureasomanagedclusters.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -48,10 +48,11 @@ spec:
4848
in the API schema to permit resource admission.
4949
properties:
5050
host:
51-
description: The hostname on which the API server is serving.
51+
description: host is the hostname on which the API server is serving.
52+
maxLength: 512
5253
type: string
5354
port:
54-
description: The port on which the API server is serving.
55+
description: port is the port on which the API server is serving.
5556
format: int32
5657
type: integer
5758
required:

config/crd/bases/infrastructure.cluster.x-k8s.io_azureasomanagedclustertemplates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: azureasomanagedclustertemplates.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io

config/crd/bases/infrastructure.cluster.x-k8s.io_azureasomanagedcontrolplanes.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: azureasomanagedcontrolplanes.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -63,10 +63,11 @@ spec:
6363
cluster's API server.
6464
properties:
6565
host:
66-
description: The hostname on which the API server is serving.
66+
description: host is the hostname on which the API server is serving.
67+
maxLength: 512
6768
type: string
6869
port:
69-
description: The port on which the API server is serving.
70+
description: port is the port on which the API server is serving.
7071
format: int32
7172
type: integer
7273
required:

0 commit comments

Comments
 (0)