Add tests for VIP finalizer handling and subnet status updates#6068
Add tests for VIP finalizer handling and subnet status updates#6068zbb88888 merged 2 commits intokubeovn:masterfrom
Conversation
Summary of ChangesHello @zbb88888, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the stability and observability of network resource management by refining how finalizers are handled across various IP-related Custom Resources (CRs) like VIPs, EIPs, FIPs, DNATs, and SNATs. The changes ensure that resources are properly cleaned up and that subnet status accurately reflects IP allocation and release, even in complex scenarios involving dependencies or race conditions. Additionally, new end-to-end tests have been added to validate these improvements and introduce testing for EIP QoS policies. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable refactoring of the finalizer and deletion logic for several CRDs, including OvnEip, Vip, and IptablesEip. The changes align with standard controller patterns by handling deletions through the update handler when a DeletionTimestamp is present. This makes the resource cleanup process more robust. The addition of comprehensive e2e tests to validate this new behavior is also a great improvement.
My main concern is the repeated use of time.Sleep in the controller logic to handle synchronization. This approach is brittle and can lead to race conditions. I've left specific comments with suggestions to replace these sleeps with more robust, event-driven mechanisms.
Pull Request Test Coverage Report for Build 20331778203Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
d3cac30 to
826e476
Compare
- Introduced a new test to verify that the subnet status is correctly updated when a VIP is created and deleted, ensuring that finalizers are properly handled. - Added checks for both IPv4 and IPv6 protocols, including dual stack scenarios, to confirm that available and using IP counts and ranges are updated as expected. - Enhanced the existing VIP creation test to wait for the finalizer to be added before proceeding with subnet status verification. - Updated sleep durations to ensure sufficient time for status updates after VIP operations. Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
4e2edeb to
297750b
Compare
…vn#6068) * Add tests for VIP finalizer handling and subnet status updates - Introduced a new test to verify that the subnet status is correctly updated when a VIP is created and deleted, ensuring that finalizers are properly handled. - Added checks for both IPv4 and IPv6 protocols, including dual stack scenarios, to confirm that available and using IP counts and ranges are updated as expected. - Enhanced the existing VIP creation test to wait for the finalizer to be added before proceeding with subnet status verification. - Updated sleep durations to ensure sufficient time for status updates after VIP operations. Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com> * fix after review Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com> --------- Signed-off-by: zbb88888 <jmdxjsjgcxy@gmail.com>
Pull Request
What type of this PR
Examples of user facing changes:
Bug fixes
将其他三种从 kube-ovn-controller 外部的 ip 的 finalizer 添加和删除调整为基本一致,避免出现subnet status 统计不准导致 subnet 一直触发更新入队的问题
调整一部分 CRd del equeue 的指针指向 copy 后的资源(不需要,已回滚)
将 iptables 的 e2e 拆分为两个,qos 的测试流程耗时较长 > 15分钟。 便于快速验证 iptables-eip CR 业务问题和 qos 功能问题
Which issue(s) this PR fixes
Fixes #(issue-number)