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

bryan-cox and others added 6 commits October 16, 2025 15:43
- Update core Kubernetes dependencies from v0.32.3 to v0.33.4:
  - k8s.io/api, k8s.io/apimachinery, k8s.io/client-go
  - k8s.io/apiserver, k8s.io/cli-runtime, k8s.io/kubectl
  - k8s.io/apiextensions-apiserver, k8s.io/component-base
- Upgrade prometheus/client_golang from v1.19.1 to v1.22.0
- Update cel.dev/expr from v0.18.0 to v0.19.1
- Upgrade google/cel-go from v0.22.0 to v0.23.2
- Update golang.org/x/time from v0.8.0 to v0.9.0
- Upgrade gRPC from v1.67.3 to v1.68.1
- Update OpenTelemetry packages to v1.33.0
- Refresh k8s.io/utils and other indirect dependencies
- Update kube-openapi and structured-merge-diff versions
- Upgrade cluster-api from v1.10.2 to v1.11.1
- Upgrade controller-runtime from v0.20.4 to v0.21.0
- Update various golang.org/x/* packages
- Update testing dependencies (ginkgo, gomega)
- Update OpenTelemetry and other indirect dependencies
Signed-off-by: Borja Clemente <[email protected]>
- 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.

Signed-off-by: Borja Clemente <[email protected]>
@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

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

@chrischdi chrischdi Oct 23, 2025

Choose a reason for hiding this comment

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

If I'm right then this package should not import clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"

It should use keep using clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"

Otherwise this could be considered a breaking api change (same for the whole package)


clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/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.

Also here,

If I'm right then this package should not import clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"

It should use keep using clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"

Otherwise this could be considered a breaking api change (same for the whole package)

Comment on lines +172 to +173
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta1"
alias: clusterv1
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
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta1"
alias: clusterv1
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta2"
alias: clusterv1
- pkg: "sigs.k8s.io/cluster-api/api/core/v1beta1"
alias: clusterv1beta1
  • make lint-fix (or golangci-lint run --fix)

func EnsurePausedCondition(ctx context.Context, c client.Client, cluster *clusterv1.Cluster, obj ConditionSetter) (isPaused bool, conditionChanged bool, err error) {
oldCondition := conditions.Get(obj, clusterv1.PausedV1Beta2Condition)
newCondition := pausedCondition(c.Scheme(), cluster, obj, clusterv1.PausedV1Beta2Condition)
oldCondition := conditions.Get(obj, PausedCondition)
Copy link
Member

Choose a reason for hiding this comment

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

Why adding your own instead of re-using clusterv1beta1.PausedCondition as before?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

@clebs clebs Oct 23, 2025

Choose a reason for hiding this comment

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

Yes, that makes sense, I do not recall this change. Might have been by accident (claude)...

Looking at your suggestion, both methods seem to be the same. Does this mean we can get rid of the whole paused package on CAPA?

Copy link
Member

Choose a reason for hiding this comment

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

highly likely, in CAPV we just use the util from CAPI.

"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/patch"
"sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
patch "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"
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
patch "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"
v1beta1patch "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/patch"

Let's be explicit and also add this to golangci-lint config :-)

@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-test d03484c link true /test pull-cluster-api-provider-aws-test
pull-cluster-api-provider-aws-verify d03484c link true /test pull-cluster-api-provider-aws-verify
pull-cluster-api-provider-aws-build d03484c link true /test pull-cluster-api-provider-aws-build
pull-cluster-api-provider-aws-e2e-blocking d03484c 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.


clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" "sigs.k8s.io/cluster-api/test/framework"
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
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" "sigs.k8s.io/cluster-api/test/framework"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
"sigs.k8s.io/cluster-api/test/framework"

"sigs.k8s.io/cluster-api/util"
capiannotations "sigs.k8s.io/cluster-api/util/annotations"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
Copy link
Member

Choose a reason for hiding this comment

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

Let's also use the import alias via golangci lint maybe?

v1beta1conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"

Helps for consistency IMHO

g.Expect(cluster.Spec.ControlPlaneEndpoint.Port).To(BeZero())
expectAWSClusterConditions(g, cs.AWSCluster, []conditionAssertion{
{conditionType: infrav1.LoadBalancerReadyCondition, status: corev1.ConditionFalse, severity: clusterv1.ConditionSeverityInfo, reason: infrav1.WaitForExternalControlPlaneEndpointReason},
{conditionType: infrav1beta1.LoadBalancerReadyCondition, status: corev1.ConditionFalse, severity: clusterv1beta1.ConditionSeverityInfo, reason: infrav1beta1.WaitForExternalControlPlaneEndpointReason},
Copy link
Member

@chrischdi chrischdi Oct 23, 2025

Choose a reason for hiding this comment

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

This changes should not be there or required I think.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this is wrong if the CAPA types stay on CAPI v1beta1. Confusion came from treating CAPI v1beta2 and CAPA v1beta2 as the same.

Now I understand that CAPA v1beta2 makes use of CAPI v1beta1, and so I have to revert CAPA v1beta1 to v1beta2 everywhere.

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?

var errMessage string
for _, subnet := range subnets {
if failureDomain != nil && *subnet.AvailabilityZone != *failureDomain {
if *subnet.AvailabilityZone != failureDomain {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change introduces a regression. Check for failureDomain != "" in addition to the existing condition here. Removing the nil check and omitting this breaks MachineDeployments without a failure domain configured.

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

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. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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

6 participants