Skip to content
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

Merged

Conversation

vdemeester
Copy link
Member

Changes

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.

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 vdemeest@redhat.com

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:

Release Notes

Fix controller panicking on missing Timeout on TaskRun (existing or new)

@tekton-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jul 16, 2019
@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 16, 2019
@vdemeester vdemeester added this to the Pipelines 0.5 🐱 milestone Jul 16, 2019
@bobcatfish
Copy link
Collaborator

woot seems like a reasonable simple fix for this! Thanks @vdemeester 🎉

/lgtm
/meow space

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

woot seems like a reasonable simple fix for this! Thanks @vdemeester 🎉

/lgtm
/meow space

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.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2019
@bobcatfish
Copy link
Collaborator

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) 🤔🤔🤔

@vdemeester
Copy link
Member Author

hm I wonder if we should add a test case @vdemeester

I think we need to revisit this asap anyway so its not critical thinking and like you were pointing out in the original PR, we shouldn't get into this state anyway (once we fix the defaulting) thinkingthinkingthinking

Let me take a look real quick

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2019
@vdemeester vdemeester force-pushed the 1075-do-not-panic-on-timeout branch from 0962b50 to 76bfb0c Compare July 16, 2019 14:32
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 16, 2019
@vdemeester
Copy link
Member Author

Updated with a test case 👼
/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2019
`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 <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the 1075-do-not-panic-on-timeout branch from 76bfb0c to b3d2794 Compare July 16, 2019 15:18
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 16, 2019
@dlorenc
Copy link
Contributor

dlorenc commented Jul 16, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2019
@tekton-robot tekton-robot merged commit 4cd1d52 into tektoncd:master Jul 16, 2019
@vdemeester vdemeester deleted the 1075-do-not-panic-on-timeout branch July 16, 2019 16:07
@vdemeester vdemeester mentioned this pull request Jul 16, 2019
3 tasks
@@ -495,6 +498,7 @@ func (c *Reconciler) updateTaskRunStatusForTimeout(tr *v1alpha1.TaskRun, dp Dele
}
}

timeout := tr.Spec.Timeout.Duration
Copy link
Collaborator

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 🤔

@bobcatfish
Copy link
Collaborator

Thanks for adding the tests! ❤️❤️❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGSEGV in Reconciler
5 participants