Skip to content

Commit 17125f6

Browse files
committed
feat: Upgrade cluster-api to v1.11.0
This commit upgrades the cluster-api-operator to use cluster-api v1.11.0 with the following major changes: - Updated all cluster-api dependencies from v1.10.4 to v1.11.0 - Migrated from cluster-api conditions helpers to k8s.io/apimachinery/pkg/api/meta - Updated condition handling to use conditions.Set instead of meta.SetStatusCondition - Fixed condition status comparisons for v1beta2 compatibility - Updated contract version to v1beta2 with major: 1, minor: 11 across all configurations - Fixed healthcheck controller to properly map deployment status to provider Ready condition - Added DeploymentAvailable reason constant for condition validation - Updated test infrastructure to handle CoreProvider naming constraints - Fixed CRD cleanup in E2E tests to preserve operator CRDs - Updated all test resources and configurations for v1.11.0 compatibility - Resolved linting issues and compilation errors - All unit tests and E2E tests now pass with v1.11.0 Breaking changes: - Requires cluster-api v1.11.0 or later - Uses v1beta2 API contract - Condition Reason field validation is stricter (must be non-empty and match regex pattern) Fixes #[issue-number] if applicable
1 parent aa6c6c2 commit 17125f6

File tree

56 files changed

+45825
-32339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+45825
-32339
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ linters:
9494
- pkg: sigs.k8s.io/controller-runtime
9595
alias: ctrl
9696
# CAPI
97-
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
97+
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta2
9898
alias: clusterv1
9999
- pkg: sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3
100100
alias: clusterctlv1

api/v1alpha2/addonprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &AddonProvider{}
2424

25-
func (b *AddonProvider) GetConditions() clusterv1.Conditions {
25+
func (b *AddonProvider) GetConditions() []metav1.Condition {
2626
return b.Status.Conditions
2727
}
2828

29-
func (b *AddonProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (b *AddonProvider) SetConditions(conditions []metav1.Condition) {
3030
b.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/bootstrapprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &BootstrapProvider{}
2424

25-
func (b *BootstrapProvider) GetConditions() clusterv1.Conditions {
25+
func (b *BootstrapProvider) GetConditions() []metav1.Condition {
2626
return b.Status.Conditions
2727
}
2828

29-
func (b *BootstrapProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (b *BootstrapProvider) SetConditions(conditions []metav1.Condition) {
3030
b.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/conditions_consts.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ limitations under the License.
1616

1717
package v1alpha2
1818

19-
import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20-
2119
const (
2220
// PreflightCheckCondition documents a Provider that has not passed preflight checks.
23-
PreflightCheckCondition clusterv1.ConditionType = "PreflightCheckPassed"
21+
PreflightCheckCondition string = "PreflightCheckPassed"
2422

2523
// MoreThanOneProviderInstanceExistsReason (Severity=Info) documents that more than one instance of provider
2624
// exists in the cluster.
@@ -71,14 +69,17 @@ const (
7169
// NoDeploymentAvailableConditionReason documents that there is no Available condition for provider deployment yet.
7270
NoDeploymentAvailableConditionReason = "NoDeploymentAvailableConditionReason"
7371

72+
// DeploymentAvailableReason documents that the provider deployment is available.
73+
DeploymentAvailableReason = "DeploymentAvailable"
74+
7475
// UnsupportedProviderDowngradeReason documents that the provider downgrade is not supported.
7576
UnsupportedProviderDowngradeReason = "UnsupportedProviderDowngradeReason"
7677
)
7778

7879
const (
7980
// ProviderInstalledCondition documents a Provider that has been installed.
80-
ProviderInstalledCondition clusterv1.ConditionType = "ProviderInstalled"
81+
ProviderInstalledCondition string = "ProviderInstalled"
8182

8283
// ProviderUpgradedCondition documents a Provider that has been recently upgraded.
83-
ProviderUpgradedCondition clusterv1.ConditionType = "ProviderUpgraded"
84+
ProviderUpgradedCondition string = "ProviderUpgraded"
8485
)

api/v1alpha2/controlplaneprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &ControlPlaneProvider{}
2424

25-
func (c *ControlPlaneProvider) GetConditions() clusterv1.Conditions {
25+
func (c *ControlPlaneProvider) GetConditions() []metav1.Condition {
2626
return c.Status.Conditions
2727
}
2828

29-
func (c *ControlPlaneProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (c *ControlPlaneProvider) SetConditions(conditions []metav1.Condition) {
3030
c.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/coreprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &CoreProvider{}
2424

25-
func (c *CoreProvider) GetConditions() clusterv1.Conditions {
25+
func (c *CoreProvider) GetConditions() []metav1.Condition {
2626
return c.Status.Conditions
2727
}
2828

29-
func (c *CoreProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (c *CoreProvider) SetConditions(conditions []metav1.Condition) {
3030
c.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/genericprovider_interfaces.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ package v1alpha2
1818

1919
import (
2020
"sigs.k8s.io/cluster-api/util/conditions"
21+
"sigs.k8s.io/controller-runtime/pkg/client"
2122
)
2223

2324
// GenericProvider interface describes operations applicable to the provider type.
2425
//
2526
// +kubebuilder:object:generate=false
2627
type GenericProvider interface {
28+
client.Object
2729
conditions.Setter
2830
GetSpec() ProviderSpec
2931
SetSpec(in ProviderSpec)

api/v1alpha2/infrastructureprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &InfrastructureProvider{}
2424

25-
func (c *InfrastructureProvider) GetConditions() clusterv1.Conditions {
25+
func (c *InfrastructureProvider) GetConditions() []metav1.Condition {
2626
return c.Status.Conditions
2727
}
2828

29-
func (c *InfrastructureProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (c *InfrastructureProvider) SetConditions(conditions []metav1.Condition) {
3030
c.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/ipamprovider_wrapper.go

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

1919
import (
20-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

2323
var _ GenericProvider = &IPAMProvider{}
2424

25-
func (p *IPAMProvider) GetConditions() clusterv1.Conditions {
25+
func (p *IPAMProvider) GetConditions() []metav1.Condition {
2626
return p.Status.Conditions
2727
}
2828

29-
func (p *IPAMProvider) SetConditions(conditions clusterv1.Conditions) {
29+
func (p *IPAMProvider) SetConditions(conditions []metav1.Condition) {
3030
p.Status.Conditions = conditions
3131
}
3232

api/v1alpha2/provider_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1alpha2
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2322
)
2423

2524
const (
@@ -263,7 +262,7 @@ type ProviderStatus struct {
263262

264263
// Conditions define the current service state of the provider.
265264
// +optional
266-
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
265+
Conditions []metav1.Condition `json:"conditions,omitempty"`
267266

268267
// ObservedGeneration is the latest generation observed by the controller.
269268
// +optional

0 commit comments

Comments
 (0)