-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not panic if Timeout is nil #1085
Do not panic if Timeout is nil #1085
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
woot seems like a reasonable simple fix for this! Thanks @vdemeester 🎉 /lgtm |
In 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 kubernetes/test-infra repository. |
hm I wonder if we should add a test case @vdemeester I think we need to revisit this asap anyway so its not critical 🤔 and like you were pointing out in the original PR, we shouldn't get into this state anyway (once we fix the defaulting) 🤔🤔🤔 |
Let me take a look real quick /hold |
0962b50
to
76bfb0c
Compare
Updated with a test case 👼 |
`TaskRun` and `PipelineRun` should have a default Timeout set by the webhook. That said, if the webhook didn't do its work, or the object where created before those webhook defaults, it could be nil and makes the controller panicking. Signed-off-by: Vincent Demeester <[email protected]>
76bfb0c
to
b3d2794
Compare
/lgtm |
@@ -495,6 +498,7 @@ func (c *Reconciler) updateTaskRunStatusForTimeout(tr *v1alpha1.TaskRun, dp Dele | |||
} | |||
} | |||
|
|||
timeout := tr.Spec.Timeout.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm this is interesting cuz it means if the order of the call to this function were to change, this could still be nil 🤔
Thanks for adding the tests! ❤️❤️❤️ |
Changes
TaskRun
andPipelineRun
should have a default Timeout set by thewebhook. That said, if the webhook didn't do its work, or the object
where created before those webhook defaults, it could be nil and makes
the controller panicking.
This is a simplest fix for #1075 than #1083 to make the simplest fix for the bug-fix release. Closes #1075.
/cc @bobcatfish
Signed-off-by: Vincent Demeester [email protected]
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task and TaskRun to build and release this image
Release Notes