feat(eni): add IPStatusInvalid and update status handling for invalid…#942
Conversation
… IPs Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 21
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: Invalid IPs assigned in takeover case
The takeover logic assigns IPs to pods without checking the IP status. This allows pods to be assigned IPs with IPStatusInvalid or IPStatusDeleting status, which could be non-functional or in the process of being removed. The normal assignment flow at lines 722 and 767 correctly filters for IPStatusValid, but the takeover case at lines 676-680 and 689-693 lacks this validation, creating an inconsistency that could assign invalid IPs to pods.
pkg/controller/multi-ip/node/pool.go#L675-L680
terway/pkg/controller/multi-ip/node/pool.go
Lines 675 to 680 in 5465d9e
pkg/controller/multi-ip/node/pool.go#L688-L693
terway/pkg/controller/multi-ip/node/pool.go
Lines 688 to 693 in 5465d9e
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #942 +/- ##
==========================================
+ Coverage 61.76% 61.77% +0.01%
==========================================
Files 131 131
Lines 16096 16106 +10
==========================================
+ Hits 9942 9950 +8
- Misses 4980 4983 +3
+ Partials 1174 1173 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… IPs
Note
Introduce
InvalidIP status and update ENI sync/release logic to mark in-use missing IPs invalid, keep primary IPs, and transition invalid IPs to deleting; bump Node CRD to v0.6.1.Invalidto IPstatusenum inpkg/apis/crds/network.alibabacloud.com_nodes.yaml(IPv4/IPv6).CRDNodeversion tov0.6.1inpkg/apis/crds/register.go.IPStatusInvalidinpkg/apis/network.alibabacloud.com/v1beta1/node_types.goand update validation enum.mergeIPMap: preserveprimaryIPs missing from remote; mark in-use missing IPs asInvalid; delete others.releasePodNotFound: transition non-primaryInvalidIPs toDeletingwhen pod is released.Invalidand primary IP preservation.Written by Cursor Bugbot for commit 5465d9e. This will update automatically on new commits. Configure here.