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-39403 - Fix parseIPList to Continue Processing After Invalid IPs and Return Valid IPs #621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mJace
Copy link

@mJace mJace commented Aug 30, 2024

Summary

This PR updates the parseIPList function to handle IP lists containing invalid IPs or CIDRs more gracefully. Previously, the function would return an empty string as soon as it encountered an invalid IP or CIDR. This update ensures that the function will now continue processing the rest of the list and return a space-separated string of all valid IPs and CIDRs.

Changes

  • Modified parseIPList to:
    • Collect both valid and invalid IPs or CIDRs.
    • Log all invalid entries for troubleshooting.
    • Return a string of valid IPs and CIDRs, or an empty string if none are valid.

Benefits

  • Improved Robustness: The function now handles mixed validity IP lists more gracefully, allowing valid entries to be processed even if there are some invalid entries.
  • Enhanced Debugging: Logging of invalid IPs or CIDRs provides better visibility into issues with input data.

Additional Notes

  • The function continues to trim and validate input while logging detailed information about invalid entries.
  • Ensure to review and test the function with various IP list scenarios to confirm the correctness of the changes.

Copy link
Contributor

openshift-ci bot commented Aug 30, 2024

[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 knobunc for approval. For more information see the Kubernetes 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

Copy link
Contributor

openshift-ci bot commented Aug 30, 2024

Hi @mJace. Thanks for your PR.

I'm waiting for a openshift 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. Regular contributors should join the org to skip this step.

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.

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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 30, 2024
@alebedev87
Copy link
Contributor

/assign

@mJace mJace changed the title Fix parseIPList to Continue Processing After Invalid IPs and Return Valid IPs OCPBUGS-39403 - Fix parseIPList to Continue Processing After Invalid IPs and Return Valid IPs Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants