Skip to content

⚠️ Group API server fields under spec.apiServer#3169

Merged
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
nikParasyr:v1beta2_lb
Jun 1, 2026
Merged

⚠️ Group API server fields under spec.apiServer#3169
k8s-ci-robot merged 2 commits into
kubernetes-sigs:mainfrom
nikParasyr:v1beta2_lb

Conversation

@nikParasyr

@nikParasyr nikParasyr commented May 18, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Consolidate the various flat API server fields (apiServerFloatingIP, apiServerFixedIP, apiServerPort, disableAPIServerFloatingIP, and apiServerLoadBalancer) into a single structured spec.apiServer object, with apiServerLoadBalancer renamed to managedLoadBalancer within it. Includes conversion from v1beta1 and updated webhook validation.

Which issue(s) this PR fixes :
Fixes #2899

Special notes for your reviewer:

  1. Not sure whether OSC.status should be updated as well to reflect this change. Open to suggestions => addressed

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2026
@netlify

netlify Bot commented May 18, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 2225c1f
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/6a1535b96e41a00009dc6d3e
😎 Deploy Preview https://deploy-preview-3169--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 k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 18, 2026
@k8s-ci-robot k8s-ci-robot requested review from EmilienM and mandre May 18, 2026 07:53
@nikParasyr nikParasyr force-pushed the v1beta2_lb branch 2 times, most recently from 7b48a64 to de89db1 Compare May 18, 2026 08:36
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 18, 2026
@nikParasyr nikParasyr force-pushed the v1beta2_lb branch 6 times, most recently from 967292a to 4a40e56 Compare May 18, 2026 11:07
@nikParasyr

Copy link
Copy Markdown
Contributor Author

/test pull-cluster-api-provider-openstack-e2e-full-test

@nikParasyr

Copy link
Copy Markdown
Contributor Author

/retest

@nikParasyr

Copy link
Copy Markdown
Contributor Author

@lentzi90 && @bnallapeta, this is ready from my side

@bnallapeta bnallapeta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall. Minor comment.

Also, on the status question, I think its best to change the below to maintain consistency. If we don't do this, we might carry the inconsistency in naming in the long run.

Status.APIServerLoadBalancer → Status.ManagedAPIServerLoadBalancer


for _, v := range flavors {
if v.Enabled && v.Name == *openStackCluster.Spec.APIServerLoadBalancer.Flavor {
if v.Enabled && v.Name == *openStackCluster.Spec.APIServer.ManagedLoadBalancer.Flavor {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

technically, although this is the same, I think we should change this to lbSpec.Flavour to maintain consistency with the rest of the code.

}
if lbFlavorID == "" {
record.Warnf(openStackCluster, "OctaviaFlavorNotFound", "Flavor %s specified for Octavia not found, using the default flavor.", *openStackCluster.Spec.APIServerLoadBalancer.Flavor)
record.Warnf(openStackCluster, "OctaviaFlavorNotFound", "Flavor %s specified for Octavia not found, using the default flavor.", *openStackCluster.Spec.APIServer.ManagedLoadBalancer.Flavor)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above.

}

availabilityZone = openStackCluster.Spec.APIServerLoadBalancer.AvailabilityZone
availabilityZone = openStackCluster.Spec.APIServer.ManagedLoadBalancer.AvailabilityZone

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above.

@lentzi90 lentzi90 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great stuff!
I have basically only one thing that needs fixing. The other two are just minor things.
We probably don't test that specific jsonpatch in the e2e tests so this is why it wasn't detected.

Comment thread templates/clusterclass-dev-test.yaml Outdated
Comment thread controllers/openstackmachine_controller.go Outdated
Comment thread kustomize/without-lb/patch-without-lb.yaml
Consolidate the various flat API server fields (apiServerFloatingIP,
apiServerFixedIP, apiServerPort, disableAPIServerFloatingIP, and
apiServerLoadBalancer) into a single structured spec.apiServer object,
with apiServerLoadBalancer renamed to managedLoadBalancer within it.
Includes conversion from v1beta1 and updated webhook validation.
…ancer

Rename the status field for consistency with the spec-side rename introduced
in the API server fields restructure (spec.apiServer.managedLoadBalancer).
Includes conversion functions and updated tests.
@nikParasyr

Copy link
Copy Markdown
Contributor Author

/test pull-cluster-api-provider-openstack-e2e-full-test

@nikParasyr

Copy link
Copy Markdown
Contributor Author

@lentzi90 && @bnallapeta:
I think ive addressed all your remarks ( amended on the first commit ).
I also made a second commit the the status change ( apiServerLoadBalancer => apiServerManagedLoadBalancer)

@lentzi90 lentzi90 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2026
@nikParasyr nikParasyr requested a review from bnallapeta May 27, 2026 13:00
@bnallapeta

Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2026
@nikParasyr

Copy link
Copy Markdown
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 1, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@nikParasyr: The following test 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-openstack-e2e-test 2225c1f link unknown /test pull-cluster-api-provider-openstack-e2e-test

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.

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. I understand the commands that are listed here.

@nikParasyr

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@nikParasyr

Copy link
Copy Markdown
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 46bb4b6 into kubernetes-sigs:main Jun 1, 2026
21 of 23 checks passed
@github-project-automation github-project-automation Bot moved this from Inbox to Done in CAPO Roadmap Jun 1, 2026
@nikParasyr nikParasyr deleted the v1beta2_lb branch June 1, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

✨ v1beta2 Group apiServer related fields on OpenStackCluster

4 participants