Skip to content

Commit d613796

Browse files
authored
Merge pull request #59 from leaseweb/develop
feat: Support K8s v1.32
2 parents badbf24 + 80ca943 commit d613796

29 files changed

+410
-531
lines changed

Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,17 @@ get_go_version = $(shell go list -m $1 | awk '{print $$2}')
3939
LDFLAGS := $(shell source ./hack/version.sh; version::ldflags)
4040

4141
# Binaries
42-
KUSTOMIZE_VER := v5.3.0
42+
KUSTOMIZE_VER := v5.6.0
4343
KUSTOMIZE_BIN := kustomize
4444
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
4545
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v5
4646

47-
# This is a commit from CR main (22.05.2024).
48-
# Intentionally using a commit from main to use a setup-envtest version
49-
# that uses binaries from controller-tools, not GCS.
50-
# CR PR: https://github.com/kubernetes-sigs/controller-runtime/pull/2811
51-
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60
47+
SETUP_ENVTEST_VER := release-0.19
5248
SETUP_ENVTEST_BIN := setup-envtest
5349
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
5450
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
5551

56-
CONTROLLER_GEN_VER := v0.15.0
52+
CONTROLLER_GEN_VER := v0.16.1
5753
CONTROLLER_GEN_BIN := controller-gen
5854
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
5955
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen
@@ -63,7 +59,7 @@ GOTESTSUM_BIN := gotestsum
6359
GOTESTSUM := $(abspath $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER))
6460
GOTESTSUM_PKG := gotest.tools/gotestsum
6561

66-
CONVERSION_GEN_VER := v0.30.10
62+
CONVERSION_GEN_VER := v0.31.8
6763
CONVERSION_GEN_BIN := conversion-gen
6864
# We are intentionally using the binary without version suffix, to avoid the version
6965
# in generated files.
@@ -86,12 +82,12 @@ GINKGO := $(abspath $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINGKO_VER))
8682
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
8783

8884
GOLANGCI_LINT_BIN := golangci-lint
89-
GOLANGCI_LINT_VER := v1.60.3
85+
GOLANGCI_LINT_VER := v1.63.4
9086
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER))
9187
GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
9288

9389
MOCKGEN_BIN := mockgen
94-
MOCKGEN_VER := v0.5.0
90+
MOCKGEN_VER := v0.5.2
9591
MOCKGEN := $(abspath $(TOOLS_BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER))
9692
MOCKGEN_PKG := go.uber.org/mock/mockgen
9793

@@ -292,7 +288,7 @@ delete-kind-cluster:
292288
kind delete cluster --name $(KIND_CLUSTER_NAME)
293289

294290
cluster-api: ## Clone cluster-api repository for tilt use.
295-
git clone --branch v1.8.10 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git
291+
git clone --branch v1.9.7 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git
296292

297293
cluster-api/tilt-settings.json: hack/tilt-settings.json cluster-api
298294
cp ./hack/tilt-settings.json cluster-api

api/v1beta3/cloudstackclustertemplate_webhook_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
var ctx = ctrl.SetupSignalHandler()
3333

3434
func TestCloudStackClusterTemplateFeatureGateEnabled(t *testing.T) {
35-
defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)()
35+
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)
3636
g := NewWithT(t)
3737

3838
tests := []struct {
@@ -96,7 +96,7 @@ func TestCloudStackClusterTemplateFeatureGateEnabled(t *testing.T) {
9696
}
9797

9898
func TestCloudStackClusterTemplateFeatureGateDisabled(t *testing.T) {
99-
defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, false)()
99+
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, false)
100100
g := NewWithT(t)
101101

102102
cct := &CloudStackClusterTemplate{
@@ -117,7 +117,7 @@ func TestCloudStackClusterTemplateFeatureGateDisabled(t *testing.T) {
117117
}
118118

119119
func TestCloudStackClusterTemplateValidationMetadata(t *testing.T) {
120-
defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)()
120+
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)
121121

122122
tests := []struct {
123123
name string
@@ -177,7 +177,7 @@ func TestCloudStackClusterTemplateValidationMetadata(t *testing.T) {
177177
}
178178

179179
func TestCloudStackClusterTemplateValidateUpdate(t *testing.T) {
180-
defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)()
180+
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.ClusterTopology, true)
181181
g := NewWithT(t)
182182

183183
invalidRegex := ".*is invalid\\:.*Invalid value\\: \\S+?\\{.*\\}\\: %s"

api/v1beta3/cloudstackmachine_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
corev1 "k8s.io/api/core/v1"
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
25-
"sigs.k8s.io/cluster-api/errors"
2625
)
2726

2827
// The presence of a finalizer prevents CAPI from deleting the corresponding CAPI data.
@@ -159,7 +158,7 @@ type CloudStackMachineStatus struct {
159158
// can be added as events to the Machine object and/or logged in the
160159
// controller's output.
161160
// +optional
162-
FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`
161+
FailureReason *string `json:"failureReason,omitempty"`
163162

164163
// FailureMessage will be set in the event that there is a terminal problem
165164
// reconciling the Machine and will contain a more verbose string suitable

api/v1beta3/zz_generated.deepcopy.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackaffinitygroups.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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackaffinitygroups.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io

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

Lines changed: 11 additions & 12 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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackclusters.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -129,11 +129,11 @@ spec:
129129
attributes:
130130
additionalProperties:
131131
type: string
132-
description: Attributes is a free form map of attributes an
132+
description: attributes is a free form map of attributes an
133133
infrastructure provider might use or require.
134134
type: object
135135
controlPlane:
136-
description: ControlPlane determines if this failure domain
136+
description: controlPlane determines if this failure domain
137137
is suitable for use by control plane machines.
138138
type: boolean
139139
type: object
@@ -312,11 +312,11 @@ spec:
312312
attributes:
313313
additionalProperties:
314314
type: string
315-
description: Attributes is a free form map of attributes an
315+
description: attributes is a free form map of attributes an
316316
infrastructure provider might use or require.
317317
type: object
318318
controlPlane:
319-
description: ControlPlane determines if this failure domain
319+
description: controlPlane determines if this failure domain
320320
is suitable for use by control plane machines.
321321
type: boolean
322322
type: object
@@ -394,7 +394,6 @@ spec:
394394
Enabled defines whether a load balancer should be created. This value
395395
defaults to true if an APIServerLoadBalancer is given.
396396
397-
398397
There is no reason to set this to false. To disable creation of the
399398
API server loadbalancer, omit the APIServerLoadBalancer field in the
400399
cluster spec instead.
@@ -522,20 +521,20 @@ spec:
522521
description: |-
523522
The reason for the condition's last transition in CamelCase.
524523
The specific API may choose whether or not this field is considered a guaranteed API.
525-
This field may not be empty.
524+
This field may be empty.
526525
type: string
527526
severity:
528527
description: |-
529-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
528+
severity provides an explicit classification of Reason code, so the users or machines can immediately
530529
understand the current situation and act accordingly.
531530
The Severity field MUST be set only when Status=False.
532531
type: string
533532
status:
534-
description: Status of the condition, one of True, False, Unknown.
533+
description: status of the condition, one of True, False, Unknown.
535534
type: string
536535
type:
537536
description: |-
538-
Type of condition in CamelCase or in foo.example.com/CamelCase.
537+
type of condition in CamelCase or in foo.example.com/CamelCase.
539538
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
540539
can be useful (see .node.status.conditions), the ability to deconflict is important.
541540
type: string
@@ -554,11 +553,11 @@ spec:
554553
attributes:
555554
additionalProperties:
556555
type: string
557-
description: Attributes is a free form map of attributes an
556+
description: attributes is a free form map of attributes an
558557
infrastructure provider might use or require.
559558
type: object
560559
controlPlane:
561-
description: ControlPlane determines if this failure domain
560+
description: controlPlane determines if this failure domain
562561
is suitable for use by control plane machines.
563562
type: boolean
564563
type: object

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

Lines changed: 2 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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackclustertemplates.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -63,7 +63,7 @@ spec:
6363
additionalProperties:
6464
type: string
6565
description: |-
66-
Annotations is an unstructured key value map stored with a resource that may be
66+
annotations is an unstructured key value map stored with a resource that may be
6767
set by external tools to store and retrieve arbitrary metadata. They are not
6868
queryable and should be preserved when modifying objects.
6969
More info: http://kubernetes.io/docs/user-guide/annotations
@@ -107,7 +107,6 @@ spec:
107107
Enabled defines whether a load balancer should be created. This value
108108
defaults to true if an APIServerLoadBalancer is given.
109109
110-
111110
There is no reason to set this to false. To disable creation of the
112111
API server loadbalancer, omit the APIServerLoadBalancer field in the
113112
cluster spec instead.

config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackfailuredomains.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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackfailuredomains.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io

config/crd/bases/infrastructure.cluster.x-k8s.io_cloudstackisolatednetworks.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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackisolatednetworks.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io

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

Lines changed: 5 additions & 12 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.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: cloudstackmachines.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -91,7 +91,6 @@ spec:
9191
the event) or if no container name is specified "spec.containers[2]" (container with
9292
index 2 in this pod). This syntax is chosen only to have some well-defined way of
9393
referencing a part of an object.
94-
TODO: this design is not final and this field is subject to change in the future.
9594
type: string
9695
kind:
9796
description: |-
@@ -341,7 +340,6 @@ spec:
341340
the event) or if no container name is specified "spec.containers[2]" (container with
342341
index 2 in this pod). This syntax is chosen only to have some well-defined way of
343342
referencing a part of an object.
344-
TODO: this design is not final and this field is subject to change in the future.
345343
type: string
346344
kind:
347345
description: |-
@@ -584,7 +582,6 @@ spec:
584582
the event) or if no container name is specified "spec.containers[2]" (container with
585583
index 2 in this pod). This syntax is chosen only to have some well-defined way of
586584
referencing a part of an object.
587-
TODO: this design is not final and this field is subject to change in the future.
588585
type: string
589586
kind:
590587
description: |-
@@ -745,20 +742,20 @@ spec:
745742
description: |-
746743
The reason for the condition's last transition in CamelCase.
747744
The specific API may choose whether or not this field is considered a guaranteed API.
748-
This field may not be empty.
745+
This field may be empty.
749746
type: string
750747
severity:
751748
description: |-
752-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
749+
severity provides an explicit classification of Reason code, so the users or machines can immediately
753750
understand the current situation and act accordingly.
754751
The Severity field MUST be set only when Status=False.
755752
type: string
756753
status:
757-
description: Status of the condition, one of True, False, Unknown.
754+
description: status of the condition, one of True, False, Unknown.
758755
type: string
759756
type:
760757
description: |-
761-
Type of condition in CamelCase or in foo.example.com/CamelCase.
758+
type of condition in CamelCase or in foo.example.com/CamelCase.
762759
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
763760
can be useful (see .node.status.conditions), the ability to deconflict is important.
764761
type: string
@@ -774,7 +771,6 @@ spec:
774771
reconciling the Machine and will contain a more verbose string suitable
775772
for logging and human consumption.
776773
777-
778774
This field should not be set for transitive errors that a controller
779775
faces that are expected to be fixed automatically over
780776
time (like service outages), but instead indicate that something is
@@ -784,7 +780,6 @@ spec:
784780
spec, values that are unsupported by the controller, or the
785781
responsible controller itself being critically misconfigured.
786782
787-
788783
Any transient errors that occur during the reconciliation of Machines
789784
can be added as events to the Machine object and/or logged in the
790785
controller's output.
@@ -795,7 +790,6 @@ spec:
795790
reconciling the Machine and will contain a succinct value suitable
796791
for machine interpretation.
797792
798-
799793
This field should not be set for transitive errors that a controller
800794
faces that are expected to be fixed automatically over
801795
time (like service outages), but instead indicate that something is
@@ -805,7 +799,6 @@ spec:
805799
spec, values that are unsupported by the controller, or the
806800
responsible controller itself being critically misconfigured.
807801
808-
809802
Any transient errors that occur during the reconciliation of Machines
810803
can be added as events to the Machine object and/or logged in the
811804
controller's output.

0 commit comments

Comments
 (0)