Skip to content

Conversation

@clebs
Copy link

@clebs clebs commented Oct 23, 2025

What type of PR is this?
/kind support

What this PR does / why we need it:
This PR bumps CAPI to v1.11.0, and k8s to v1.33.3.

  • Update all imports to v1beta2 types except for conditions staying in v1beta1.
  • Adapt source code to work with v1beta2 and deprecated conditions.
  • Manually update conversions.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5593

Replaces #5624

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • includes emoji in title
  • adds unit tests
  • adds or updates e2e tests

Release note:

Bump CAPI to v1.11 and k8s to v1.33

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/support Categorizes issue or PR as a support question. labels Oct 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ankitasw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added needs-priority cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 23, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @clebs!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @clebs. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 23, 2025
@clebs
Copy link
Author

clebs commented Oct 23, 2025

@richardcase This PR here based on @bryan-cox's: #5720

Changes:

  • Rebased the PR to main
  • Fixed missing/wrong go modules
  • Updated all imports to use the new v1beta2 API, except for conditions which stay on v1beta1
  • Adapted all the code to properly use the new types
  • Add adapters to use v1beta1.Conditions with v1beta1types
  • Manually fix converters for FailureDomains

Current state:

  • Code compiles
  • Generation fails because of manual conversions required
  • Working on linting issues

@chrischdi
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be bumping KUBERNETES_VERSION_MANAGEMENT and KUBERNETES_VERSION_UPGRADE_FROM to target 1.33 in this file?

Copy link
Contributor

@cnmcavoy cnmcavoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on the subnet filtering regression

@clebs clebs requested a review from chrischdi October 27, 2025 15:08
@clebs clebs force-pushed the bump-capi-k8s-deps branch from 610720a to 7dc9647 Compare November 4, 2025 16:47
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2025
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes:

  • I did not fully review the unit tests
  • Using the label constants from v1beta2 can be okay (as long as the consts did not change), so these decisions are only comments, I think up to the maintainers to decide.
    • I started to add these comments but stopped later on.
  • As a follow up: all usages of v1beta1conditions should be reviewed (places where we set v1beta1 conditions on CAPI objects like MachinePool) and considered if we additionally want to set a v1beta2 condition

"k8s.io/apimachinery/pkg/util/sets"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes:

// Instance describes an AWS instance.
type Instance struct {
...
	// Addresses contains the AWS instance associated addresses.
	Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
...

to use the v1beta2 struct.

The v1beta2 struct does now set "omitempty" so there's a change in marshalling behavoir.

My personal opinion on this is: keep using v1beta1 here, but up to the CAPA maintainers.

Impact of keeping v1beta1:
We'd have to convert

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed, in CAPA v1beta2 we keep using clusterv1beta1, so we should also do the same here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must have been set back on the rebase... I went through all these on the public API.
Will do a more in depth verification.

}

if cluster.Spec.ControlPlaneRef == nil || cluster.Spec.ControlPlaneRef.Kind != "AWSManagedControlPlane" {
if cluster.Spec.ControlPlaneRef.Name == "" || cluster.Spec.ControlPlaneRef.Kind != "AWSManagedControlPlane" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cluster.Spec.ControlPlaneRef.Name == "" || cluster.Spec.ControlPlaneRef.Kind != "AWSManagedControlPlane" {
if cluster.Spec.ControlPlaneRef.IsDefined() || cluster.Spec.ControlPlaneRef.Kind != "AWSManagedControlPlane" {

Copy link
Author

@clebs clebs Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is bad... I did do these changes. This must have been reverted on rebase somehow.
Thanks for listing them all up, I will go through the whole changeset again.

Should it not be negated though? Previous logic was checking if name is empty:

!cluster.Spec.ControlPlaneRef.IsDefined()

}

if !cluster.Status.InfrastructureReady {
if !meta.IsStatusConditionTrue(cluster.GetConditions(), string(clusterv1beta1.InfrastructureReadyCondition)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replacement is cluster.Status.Initialization.InfrastructureProvisioned

Suggested change
if !meta.IsStatusConditionTrue(cluster.GetConditions(), string(clusterv1beta1.InfrastructureReadyCondition)) {
if !ptr.Deref(cluster.Status.Initialization.InfrastructureProvisioned, false) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous ones.

new: --metrics-bind-addr=:8080
- name: v1.10.2 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.2/core-components.yaml"
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
- name: v1.11.1 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed thanks!

new: --metrics-bind-addr=:8080
- name: v1.10.2 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.2/bootstrap-components.yaml"
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.
- name: v1.11.1 # latest published release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed thanks!

new: --metrics-bind-addr=:8080
- name: v1.10.2 # latest published release in the v1beta1 series; this is used for v1beta1 --> v1beta1 latest clusterctl upgrades test only.
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.2/control-plane-components.yaml"
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> v1beta1 latest clusterctl upgrades test only.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: v1.11.0 # latest published release in the v1beta1 series; this is used for v1beta1 --> v1beta1 latest clusterctl upgrades test only.
- name: v1.11.1 # latest published release in the v1beta1 series; this is used for v1beta1 --> v1beta1 latest clusterctl upgrades test only.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the comment does not fit here.
As this releases is the v1beta2 series.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed thanks!

func pausedCondition(scheme *runtime.Scheme, cluster *clusterv1.Cluster, obj ConditionSetter, targetConditionType string) clusterv1.Condition {
if (cluster != nil && cluster.Spec.Paused) || annotations.HasPaused(obj) {
func pausedCondition(scheme *runtime.Scheme, cluster *clusterv1.Cluster, obj ConditionSetter, targetConditionType string) clusterv1beta1.Condition {
if (cluster != nil && cluster.Spec.Paused != nil && *cluster.Spec.Paused) || annotations.HasPaused(obj) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (cluster != nil && cluster.Spec.Paused != nil && *cluster.Spec.Paused) || annotations.HasPaused(obj) {
if (cluster != nil && ptr.Deref(cluster.Spec.Paused, false) || annotations.HasPaused(obj) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed Thanks!

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes:

  • I did not fully review the unit tests
  • Using the label constants from v1beta2 can be okay (as long as the consts did not change), so these decisions are only comments, I think up to the maintainers to decide.
    • I started to add these comments but stopped later on.
  • As a follow up: all usages of v1beta1conditions should be reviewed (places where we set v1beta1 conditions on CAPI objects like MachinePool) and considered if we additionally want to set a v1beta2 condition
  • Also to fix fuzz tests: we now need to use randfill.Continue instead of fuzz.Continue.

@damdo
Copy link
Member

damdo commented Nov 7, 2025

Hey @clebs thanks for your hard work on this

Have you seen: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/5720/pull-cluster-api-provider-aws-e2e-blocking/1985750779037749248#

To fix that you'll need to update these two files:

[~/src/cluster-api-provider-aws-upstream git:(main)] $ fd metadata.yaml
metadata.yaml
test/e2e/data/shared/v1beta1/metadata.yaml

And if I am remembering correctly what we said with @chrischdi we are going to still use. the v1beta1 CAPI contract for 2.9, so I'd expect something like

  - major: 2
    minor: 10
    contract: v1beta1

and

  - major: 1
    minor: 11
    contract: v1beta1

Thanks!

clebs added 3 commits November 7, 2025 13:23
Add rule to allow using deprecated v1beta1 CAPI APIs and removed linter
comments everywhere.

Signed-off-by: Borja Clemente <[email protected]>
Signed-off-by: Borja Clemente <[email protected]>
Signed-off-by: Borja Clemente <[email protected]>
@nrb nrb added this to the v2.10 milestone Nov 9, 2025
@nrb
Copy link
Contributor

nrb commented Nov 9, 2025

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Nov 9, 2025
@serngawy
Copy link
Contributor

serngawy commented Nov 10, 2025

The ROSA-HCP changes looks good but there are tests failing, Most likely because the Condition.lastTransitionTime is required as I can see from the logs messages. For example; we need to add the lastTransitionTime here for ROSACluster_test AND here for ROSAControlPlane_test. Same case for awsmanagedcontrolplane_test here

@clebs
Copy link
Author

clebs commented Nov 10, 2025

@serngawy currently working on fixing the tests.
Thanks for the pointers!

@chrischdi
Copy link
Member

chrischdi commented Nov 11, 2025

The ROSA-HCP changes looks good but there are tests failing, Most likely because the Condition.lastTransitionTime is required as I can see from the logs messages. For example; we need to add the lastTransitionTime here for ROSACluster_test AND here for ROSAControlPlane_test. Same case for awsmanagedcontrolplane_test here

I'd recommend using the (deprecated) CAPI utils for setting the conditions, as that also handles setting the lastTransitionTimestamp.

https://github.com/kubernetes-sigs/cluster-api/blob/28a446c22370f374d4326fd3cad328699c77d0af/util/deprecated/v1beta1/conditions/setter.go#L55

These are test cases so might be fine to just set the timestamp.

@clebs clebs force-pushed the bump-capi-k8s-deps branch from b9f3958 to 1252cc6 Compare November 13, 2025 13:57
Signed-off-by: Borja Clemente <[email protected]>
@clebs clebs force-pushed the bump-capi-k8s-deps branch from 1252cc6 to 04e4202 Compare November 13, 2025 14:17
ObjectMeta: metav1.ObjectMeta{
Name: "awsclusters.infrastructure.cluster.x-k8s.io",
Labels: map[string]string{
"cluster.x-k8s.io/v1beta2": "v1beta2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Suggested change
"cluster.x-k8s.io/v1beta2": "v1beta2",

Signed-off-by: Borja Clemente <[email protected]>
@k8s-ci-robot
Copy link
Contributor

@clebs: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-apidiff-main 27ab5b2 link false /test pull-cluster-api-provider-aws-apidiff-main
pull-cluster-api-provider-aws-e2e-blocking 27ab5b2 link true /test pull-cluster-api-provider-aws-e2e-blocking

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/support Categorizes issue or PR as a support question. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CAPI v1.11.0 has been released and is ready for testing

9 participants