-
Notifications
You must be signed in to change notification settings - Fork 284
⚠️ move loadbalancer opts to struct #1187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚠️ move loadbalancer opts to struct #1187
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Thanks for the PR, I assume you need update templates/*.yaml (e.g cluster-template.yaml) and maybe e2e settings |
|
I just pushed an update that contains:
|
|
/lgtm thanks for the fix ~ |
|
This is a really nice cleanup. /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apricote, mdbooth The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
|
Looks like a flaky test, was previously successful on the same commit. /retest |
| } | ||
| out.APIServerLoadBalancer = infrav1.APIServerLoadBalancer{ | ||
| Enabled: in.ManagedAPIServerLoadBalancer, | ||
| AdditionalPorts: *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancerAdditionalPorts)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for using unsafe here? couldn't it be as easy as the following?:
| AdditionalPorts: *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancerAdditionalPorts)), | |
| AdditionalPorts: in.APIServerLoadBalancerAdditionalPorts, |
| } | ||
|
|
||
| out.ManagedAPIServerLoadBalancer = in.APIServerLoadBalancer.Enabled | ||
| out.APIServerLoadBalancerAdditionalPorts = *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancer.AdditionalPorts)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for using unsafe here? couldn't it be as easy as the following?:
| out.APIServerLoadBalancerAdditionalPorts = *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancer.AdditionalPorts)) | |
| out.APIServerLoadBalancerAdditionalPorts = in.APIServerLoadBalancer.AdditionalPorts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was too slow with answering, not its merged :(
I copied this from the previous autogenerated conversion.
The code is coming from conversion-gen: https://github.com/kubernetes/code-generator/blob/7e38d5771c5636f13555f0058e5936c521d2fe13/cmd/conversion-gen/generators/conversion.go#L929
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this whole part is auto generated? If so we have to keep it, otherwise I would prefer to clean it up in a follow-up PR :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, my changes are not auto-generated, but I did not understand the semantics of the conversion code enough to remove the unsafe.Pointer logic provided by conversion-gen.
What this PR does / why we need it:
Modify the
v1beta1CRD and move the loadbalancer fieldsOpenStackClusterSpec.{ManagedAPIServerLoadBalancer,APIServerLoadBalancerAdditionalPorts}into a struct atOpenStackClusterSpec.APIServerLoadBalancerto enable adding further customizations. This was previously discussed in #1105.Which issue(s) this PR fixes:
Related to #1105
Special notes for your reviewer:
TODOs:
/hold