Repository navigation
Conversation
Signed-off-by: Ayush Raj <light1ooo7710@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Thanks @yush-1018. The fix looks correct to me, and leaving Overlap with #4106. @DsThakurRawat opened #4106 two days later with the same change, also against #4085. Flagging it only so it's visible; which one goes forward is up to the maintainers and the two of you. I've put my comments here because this one came first, and they apply to #4106 just as much. One detail from #4106 that might be worth using: its test builds On reachability: the explanation I originally gave here was wrong; see my correction below. Last note: the same unguarded dereference pattern exists in the Volcano plugin at |
… timeout test case Signed-off-by: Ayush Raj <light1ooo7710@gmail.com>
|
Thanks for the review , @abhishekKokadwar! I've addressed both suggestions:
|
|
Correction to my comment above: the reachability reason I gave is wrong. I read the history from a shallow clone, so 69a29c2 is just where my local history started, not where the default was added. The So I don't think the nil is reachable through the API server. The guard is defensive hardening for paths that build |
|
Thanks, @abhishekKokadwar! I've updated the PR description to remove the earlier commit reference and frame this purely as defensive hardening for paths that construct |
What this PR does / why we need it:
In \pkg/runtime/framework/plugins/coscheduling/coscheduling.go, \Build\ unconditionally dereferences *info.RuntimePolicy.PodGroupPolicy.Coscheduling.ScheduleTimeoutSeconds.
Because \scheduleTimeoutSeconds\ is an optional pointer field in \CoschedulingPodGroupPolicySource\ (+optional, defaulting to 60s), any path that constructs
untime.Info\ without API server defaulting (such as programmatic construction, fake clients, or unit test harnesses) leaves \ScheduleTimeoutSeconds\ as
il, which causes a nil pointer dereference panic.
This PR uses \ptr.Deref\ as defensive hardening to safely fall back to the documented default (\60\ seconds) when \ScheduleTimeoutSeconds\ is nil.
Fixes #4085
Special notes for your reviewer:
Checklist: