Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dkokkino
Copy link
Contributor

  • 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 dkokkino changed the title - Validation for API and Ingress VIPs when using user-managed load balancer OCPBUGS-53140: Validation for API and Ingress VIPs when using user-managed load balancer Mar 17, 2025
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 17, 2025
@openshift-ci-robot
Copy link
Contributor

@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

  • 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.

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.

@dkokkino
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

@dkokkino
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

@dkokkino
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@dkokkino: This pull request references Jira Issue OCPBUGS-53140, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

Copy link
Contributor

openshift-ci bot commented Mar 17, 2025

[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.

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

@dkokkino
Copy link
Contributor Author

/retest

2 similar comments
@mandre
Copy link
Member

mandre commented Mar 18, 2025

/retest

@mandre
Copy link
Member

mandre commented Mar 18, 2025

/retest

@mandre
Copy link
Member

mandre commented Mar 18, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 18, 2025
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target version (4.19.0) matches configured target version for branch (4.19.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

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:

/jira refresh

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.

@mandre
Copy link
Member

mandre commented Mar 18, 2025

Trying again to trigger the jobs. I'm not sure why they didn't run the last 2 times I tried.

/retest

@dkokkino
Copy link
Contributor Author

/retest

@dkokkino
Copy link
Contributor Author

/jira backport release-4.18,release-4.17,release-4.16,release-4.15,release-4.14

@openshift-ci-robot
Copy link
Contributor

@dkokkino: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.18
/cherrypick release-4.17
/cherrypick release-4.16
/cherrypick release-4.15
/cherrypick release-4.14

In response to this:

/jira backport release-4.18,release-4.17,release-4.16,release-4.15,release-4.14

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-cherrypick-robot

@openshift-ci-robot: once the present PR merges, I will cherry-pick it on top of release-4.14, release-4.15, release-4.16, release-4.17, release-4.18 in new PRs and assign them to you.

In response to this:

@dkokkino: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.18
/cherrypick release-4.17
/cherrypick release-4.16
/cherrypick release-4.15
/cherrypick release-4.14

In response to this:

/jira backport release-4.18,release-4.17,release-4.16,release-4.15,release-4.14

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.

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.

@dkokkino
Copy link
Contributor Author

/retest

1 similar comment
@dkokkino
Copy link
Contributor Author

/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 {
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
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

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,
		}
	}

@dkokkino
Copy link
Contributor Author

/retest

@tthvo
Copy link
Contributor

tthvo commented Mar 20, 2025

/label platform/openstack

Copy link
Contributor

@tthvo tthvo left a 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.

@tthvo
Copy link
Contributor

tthvo commented Mar 20, 2025

We should also add a unit test file for openstack platform default setting. See an example from Vsphere here.

@dkokkino
Copy link
Contributor Author

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

@dkokkino dkokkino force-pushed the OCPBUGS-53140 branch 2 times, most recently from 653f20d to bdb8587 Compare March 25, 2025 14:05
Copy link
Contributor

openshift-ci bot commented Mar 25, 2025

@dkokkino: 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
ci/prow/gofmt bdb8587 link true /test gofmt
ci/prow/aro-unit bdb8587 link true /test aro-unit

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.

Copy link
Contributor

@tthvo tthvo left a 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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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 😓).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. platform/openstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants