-
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
Implement 0 as no timeout for TaskRun and PipelineRun #1040
Conversation
aaec5b5
to
709498e
Compare
487a0bd
to
b8265bf
Compare
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.
Thanks for the PR 🎉 Looks good, just few comments (no blockers)
We should add a release-note
item other than release-note
, especially as this is a almost-breaking change as the 0
value for timeout now has a different meaning than before.
/cc @bobcatfish @abayer
/lgtm |
/lgtm |
/test pull-tekton-pipeline-integration-tests |
1b3fc99
to
df8308d
Compare
/test pull-tekton-pipeline-integration-tests |
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.
Nice work, thank you!
docs/pipelineruns.md
Outdated
- `timeout` - Specifies timeout after which the `PipelineRun` will fail. | ||
- [`timeout`] - Specifies timeout after which the `PipelineRun` will fail. If the value of | ||
`timeout` is empty, the default timeout will be applied. If the value is set to 0, | ||
there is no timeout. `PipelineRun` shares the same default timouet as `TaskRun`. You can |
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.
NIT: s/timouet/timeout
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.
thx, done
pkg/apis/config/default.go
Outdated
@@ -27,6 +28,7 @@ const ( | |||
// ConfigName is the name of the configmap | |||
DefaultsConfigName = "config-defaults" | |||
DefaultTimeoutMinutes = 60 | |||
NoTimeoutDuration = 0 * time.Minute |
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.
NIT: alignment
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.
done
If the timeout is set to 0, there is no timeout for the TaskRun and PipelineRun. If the timeout is empty, the default timeout 60 mins will be applied. If the timeout is set to -1, the taskrun is created in pipelinerun after it timed out.
/test pull-tekton-pipeline-integration-tests |
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.
Looking good, thanks again @houshengbo ! 🎉
/lgtm
/approve
/meow space
taskRunTimeout = &metav1.Duration{Duration: time.Until(pTimeoutTime)} | ||
if taskRunTimeout.Duration < 0 { | ||
taskRunTimeout = &metav1.Duration{Duration: 0 * time.Second} | ||
taskRunTimeout = &metav1.Duration{Duration: 1 * time.Second} |
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.
the more I look at this, I'm not really sure why this case is being explicitly handled at all - the way that the creation works, we could easily hit a case where by the time a TaskRun
is actually created, the current time is after pTimeoutTime
, even if this case isn't hit 🤔
But I'm fine with leaving this as-is in this PR.
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobcatfish, houshengbo 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 |
This was already done in tektoncd#1040 for TaskRuns, but PipelineRuns seem to have been missed. This fixes tektoncd#1303.
Changes
Closes: #978
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.
Release Notes