-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
OCPBUGS-53140: Validation for API and Ingress VIPs when using user-managed load balancer #9571
base: main
Are you sure you want to change the base?
Conversation
dkokkino
commented
Mar 17, 2025
- Currently when no API and Ingress VIPs are provided defaults are generated based on the available machine network CIDR.
- The change skips the above step if a user-managed load balancer is provided.
@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:
Comment In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:
Comment In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:
Comment In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
/retest |
2 similar comments
/retest |
/retest |
/jira refresh |
@mandre: This pull request references Jira Issue OCPBUGS-53140, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Trying again to trigger the jobs. I'm not sure why they didn't run the last 2 times I tried. /retest |
/retest |
/jira backport release-4.18,release-4.17,release-4.16,release-4.15,release-4.14 |
@dkokkino: The following backport issues have been created:
Queuing cherrypicks to the requested branches to be created after this PR merges: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@openshift-ci-robot: once the present PR merges, I will cherry-pick it on top of In response to this:
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. |
/retest |
1 similar comment
/retest |
p.APIVIPs = []string{vip.String()} | ||
|
||
// When using user-managed loadbalancer do not generate default API and Ingress VIPs | ||
if p.LoadBalancer.Type != configv1.LoadBalancerTypeUserManaged { |
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.
p.LoadBalancer
might be nil, we should guard against it.
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.
+1
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.
Thank you for pointing this out. I have now added a guard to create a default openshift managed load balancer if one does not exist.
if p.LoadBalancer == nil {
p.LoadBalancer = &configv1.OpenStackPlatformLoadBalancer{
Type: configv1.LoadBalancerTypeOpenShiftManagedDefault,
}
}
/retest |
/label platform/openstack |
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 think this is a good chance to add a unit test for these lbType cases. Some ideas can be:
- Default lbType + without specified VIPs
-> pass if some defaults can be figured out - Default lbType + without specified VIPs
-> fail if no defaults can be figured out - UserManaged lbType + without specified VIPs
-> fail
You can add them here, WDTY?
Edited: See #9571 (comment) but test cases are suggested as above.
We should also add a unit test file for openstack platform default setting. See an example from Vsphere here. |
@tthvo Thanks for the feedback! I have just added a unit test file for the Openstack platform defaults |
653f20d
to
bdb8587
Compare
@dkokkino: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
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.
@tthvo Thanks for the feedback! I have just added a unit test file for the Openstack platform defaults
Looks good, I just have some more tiny comments :D
func TestSetPlatformDefaults(t *testing.T) { | ||
cases := []struct { | ||
name string | ||
platform *types.Platform |
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.
This platform can just be *openstack.Platform
right?
expectedLB configv1.PlatformLoadBalancerType | ||
expectedAPIVIPs []string | ||
expectedIngressVIPs []string | ||
valid bool |
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 think we can remove this field as it is not used, and, in this context, we are testing whether the defaults are set as expected (if set at all). Whether the platform fields are valid or not is validated in installconfig.go
.
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.
Going back at my #9571 (review), i made it sound like there is some validation there, opps sorry (i.e. I edited the comment with better clarity to avoid confusion 😓).