-
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
Sort pod container statuses based on Step order in taskSpec #3256
Conversation
Hi @Peaorl. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/kind bug |
The following is the coverage report on the affected files.
|
The taskSpec passed to MakeTaskRunStatus does not have the internal steps. It is the user's taskSpec. Perhaps you are looking at the steps in the TaskRun's status? Those do have the internal steps because the code fabricates steps for them from the container statuses. You'll notice those steps are not in order relative to the user's steps. I suggest testing a TaskRun with a PipelineResource that has an error (e.g. a git resource with a repo that doesn't exist), to confirm the behavior. Also this change needs to be separated from your other PR #3138 (or, if it depends on it, you need to hold this one until that one is approved and merged). |
90141de
to
dd2bfae
Compare
The following is the coverage report on the affected files.
|
Thanks @GregDritschler ! Good catch, I made sure the updated taskSpec is passed on to the appropriate function (MakeTaskRunStatus). /hold |
So now the updated taskSpec is passed to MakeTaskRunStatus when the pod is created, but what happens on subsequent reconcile calls when the pod exists? |
This commit closes tektoncd#3239 Tekton determines the TaskRun status message of a failed TaskRun based on the results of the first terminated Step (pod container). Until now, Tekton sorted pod container statuses based on the FinishedAt and StartedAt timestamps set by Kubernetes. Occasionally, a Step terminated in response to the first terminated Step could have the same timestamps as the first terminated Step. Therefore, Tekton was not always able to correctly determine what the first terminated Step was, and as a result, Tekton may set an incorrect TaskRun status message. In this commit, pod container statuses are sorted based on the container order as specified by Tekton in the podSpec. Tekton bases this order on the user provided taskSpec and Steps added internally by Tekton. Therefore, Tekton accounts for internally added Steps when sorting pod container statuses.
dd2bfae
to
c227aa8
Compare
The following is the coverage report on the affected files.
|
I changed it such that the container order in the |
/unhold |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg 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 |
/lgtm |
@GregDritschler: changing LGTM is restricted to collaborators 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. |
/hold cancel |
Changes
This commit closes #3239
Tekton determines the
TaskRun
status message of a failedTaskRun
based on the results of the first terminatedStep
(pod container). Until now, Tekton sorted pod container statuses based on the FinishedAt and StartedAt timestamps set by Kubernetes.Occasionally, a
Step
terminated in response to the first terminatedStep
could have the same timestamps as the first terminated Step.Therefore, Tekton was not always able to correctly determine what the first terminated
Step
was, and as a result, Tekton may set an incorrectTaskRun
status message.In this commit, pod container statuses are sorted based on the container order as specified by Tekton in the podSpec.
Tekton bases this order on the user provided taskSpec and
Steps
added internally by Tekton. Therefore, Tekton accounts for internally addedSteps
when sorting pod container statuses.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 to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes