Skip to content

Add missing conditions on network error paths in OpenStackCluster reconciler#3107

Open
larainema wants to merge 1 commit intokubernetes-sigs:mainfrom
larainema:fix/add-missing-conditions-on-network-error-paths
Open

Add missing conditions on network error paths in OpenStackCluster reconciler#3107
larainema wants to merge 1 commit intokubernetes-sigs:mainfrom
larainema:fix/add-missing-conditions-on-network-error-paths

Conversation

@larainema
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Several error paths in reconcileNetworkComponents and related functions were missing proper condition updates. This meant the cluster status would not accurately reflect failures during network reconciliation — the cluster could remain in a Ready state even when network operations had failed.

Ref #2993

Changes

Controller fixes (openstackcluster_controller.go)

  1. ReconcileExternalNetwork failure — now sets NetworkReadyCondition=False with NetworkReconcileFailedReason
  2. ManagedSubnets > 1 validation error — now sets NetworkReadyCondition=False and calls handleUpdateOSCError (previously returned the error silently without updating any condition)
  3. resolveLoadBalancerNetwork failure — now sets NetworkReadyCondition=False
  4. loadbalancer.NewService failure in reconcileControlPlaneEndpoint — now calls handleUpdateOSCError to set ReadyCondition=False
  5. resolveLoadBalancerNetworkGetNetworkByParam failure — now always calls handleUpdateOSCError on failure, not only for ErrFilterMatch errors

Tests (openstackcluster_controller_test.go)

  • ManagedSubnets validation: verifies NetworkReadyCondition is set to False when more than one managed subnet is specified
  • External network failure: verifies NetworkReadyCondition is set to False when external network reconciliation fails

…onciler

Several error paths in reconcileNetworkComponents and related functions
were missing proper condition updates, which meant the cluster status
would not accurately reflect failures in network reconciliation.

Changes:
- ReconcileExternalNetwork failure now sets NetworkReadyCondition=False
- ManagedSubnets > 1 validation error now sets NetworkReadyCondition=False
  and calls handleUpdateOSCError (previously returned error silently)
- resolveLoadBalancerNetwork failure now sets NetworkReadyCondition=False
- loadbalancer.NewService failure in reconcileControlPlaneEndpoint now
  calls handleUpdateOSCError to set ReadyCondition=False
- resolveLoadBalancerNetwork: always call handleUpdateOSCError on
  GetNetworkByParam failure, not only for ErrFilterMatch errors

Tests added for external network failure and ManagedSubnets validation.

Signed-off-by: Dong Ma <winterma.dong@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 8, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit dcdb503
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/69d64111c46d58000828a026
😎 Deploy Preview https://deploy-preview-3107--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Copy Markdown
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 stephenfin for approval. For more information see the Code Review Process.

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

Details 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @larainema. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Details

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.

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants