Repository navigation
Conversation
CycleNodeStatusStatus.TimeoutTimestamp is optional, but timedOut dereferenced it unconditionally. A CycleNodeStatus that reached the DrainingPods phase without a timeout timestamp panicked the controller, and because controller-runtime recovers and requeues, the node cycle never progressed. Treat an unset timestamp as not timed out. The timestamp is only set when the CycleNodeStatus is first created, so this preserves the existing behaviour for every object that went through the Pending phase. Fixes atlassian-labs#146 Signed-off-by: Travis Sim <travis@users.noreply.github.com>
|
Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution. Already signed the CLA? To re-check, try refreshing the page. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
9b314b3 to
c8278eb
Compare
Root cause
CycleNodeStatusStatus.TimeoutTimestampis a*metav1.Timeand is optional, butCycleNodeStatusTransitioner.timedOut()dereferenced it unconditionally:The timestamp is only set in
transitionUndefinedwhen the CycleNodeStatus isfirst created. A
CycleNodeStatusthat reachesDrainingPodswith.status.timeoutTimestampunset therefore panics inside the controller.controller-runtime recovers and requeues, so the panic repeats and the node
cycle never progresses.
Fix
Return
false(not timed out yet) when the timestamp is unset. Behaviour forobjects that went through the Pending phase is unchanged.
Test
TestTimedOutinutil_test.gocovers nil, past and future timestamps.Before the fix, the nil case panics at exactly the line in the reported stack
trace:
After the fix:
Full repository test suite after the change:
go build ./...andgo vet ./pkg/controller/cyclenodestatus/transitioner/are clean.Fixes #146