MGMT-24393: Assisted Service IPv6 checks fails comparative#10340
MGMT-24393: Assisted Service IPv6 checks fails comparative#10340shay23bra wants to merge 2 commits into
Conversation
…ed-Service-IPv6-checks-fails-comparative
|
@shay23bra: This pull request references MGMT-24393 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. DetailsIn 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR normalizes API and Ingress VIP IP addresses across the cluster management flow to prevent update detection and comparison issues caused by semantically-identical but differently-formatted IP strings (particularly IPv6 addresses in expanded vs canonical form). ChangesIP Normalization for VIP Consistency
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shay23bra The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10340 +/- ##
=======================================
Coverage 44.32% 44.32%
=======================================
Files 417 417
Lines 72762 72779 +17
=======================================
+ Hits 32253 32262 +9
- Misses 37589 37594 +5
- Partials 2920 2923 +3
🚀 New features to boost your workflow:
|
|
/retest |
|
/test ? |
|
/test edge-e2e-metal-assisted-dual-stack-primary-ipv6-4-22 |
|
can you please explain why we need to normalize the VIPs in the code, instead of only normalizing them during validation when checking equality? Why isn't it sufficient? |
Normalizing only at comparison time is fragile — VIPs are compared in multiple places across the codebase (AreApiVipsIdentical, AreIngressVipsIdentical, wereClusterVipsUpdated, SetVipsData, backwards-compat handlers), and any new comparison added in the future could reintroduce the bug if it forgets to normalize. |
NormalizeCIDR() is using only on isMachineCidrEqualsToCalculatedCidr which I think is a different use case. There, one side is user input while the other is a calculated value. and the fact, it seems to only be used in isMachineCidrEqualsToCalculatedCidr, so maybe this actually exposes another similar bug LOL
this is only true if we can guarantee normalization at every ingestion path, which feels like the same maintenance problem, just shifted from comparison sites to write sites. In other words, we are not really eliminating the risk, only moving it, no? let's say a future developer adding a new VIP write path and forgetting to call NormalizeIP() could reintroduce the bug just as easily as a developer forgetting to normalize during comparison. what do you think? |
well the PostgreSQL's inet column auto-normalizes IPv6 so writing will be fine, so it's just another "safety-net", what I added catches the case even if a future write path forgets to normalize. |
|
@shay23bra: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
What I'm trying to say is that neither approach - normalizing at ingestion nor normalizing at comparison time is truly "safe by default". Both approaches still rely on future developers remembering to normalize when introducing a new flow. I'm not sure how likely that scenario is, but I don't really see a strong advantage in adding normalization at ingestion points throughout the code. On the other hand, I also don't think it's harmful, as long as the comparison itself is normalized. Bottom line, I feel the important part here is the comparison logic itself. But let's discuss it further in a call, as agreed offline |
Summary
Changes
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs, README, etc)Reviewers Checklist
Summary by CodeRabbit
Bug Fixes
Tests