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

Surfacing of actual Termination Reason in Step Status #7223

Closed
chitrangpatel opened this issue Oct 17, 2023 · 12 comments · Fixed by #7565
Closed

Surfacing of actual Termination Reason in Step Status #7223

chitrangpatel opened this issue Oct 17, 2023 · 12 comments · Fixed by #7565
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. Hacktoberfest Categorizes issue as one for Hacktoberfest 2021 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@chitrangpatel
Copy link
Contributor

chitrangpatel commented Oct 17, 2023

Current behaviour

Currently, Tekton only reports Completed and Error as Terminated Reasons in Step status after the Step terminates.

The status Error is also applied to the Steps if it "times out" or if the previous Step failed and caused this to be "skipped".
Likewise, the status Completed is applied to the Step if it actually "completed with exit code 0" or if the Step actually errored but the Task set onError: continue for that Step.

The table below summarizes it.

Termination Reason Meaning
Completed Finished successfully with exit code 0
Completed Errored but ignored since onError was set to continue.
Error Actually failed with a non-zero exit code.
Error timed out (but only the logs indicate that it timed out)
Error skipped because the previous Step failed.

This makes getting true visibility into the Steps challenging since the Termination reasons Completed and Error could mean different things.

Proposed behaviour

In order to get better visibility into what's happening in the underlying Steps, here is the proposed changes to the Termination Reason in the Step status.

Termination Reason Meaning
Completed Finished successfully with exit code 0
Continued Errored but ignored since onError was set to continue.
Error Actually failed with a non-zero exit code.
TimeoutExceeded timed out (but only the logs indicate that it timed out)
Skipped skipped because the previous Step failed.
TaskRunCancelled The task run was cancelled.

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 17, 2023
@afrittoli afrittoli added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. Hacktoberfest Categorizes issue as one for Hacktoberfest 2021 labels Oct 17, 2023
@chitrangpatel
Copy link
Contributor Author

/good-first-issue

@tekton-robot
Copy link
Collaborator

@chitrangpatel:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue

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 good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Oct 17, 2023
@chengjoey
Copy link
Member

Hi @chitrangpatel , Recently a Termination Reason Canceled has been added

output = append(output, result.RunResult{
Key: "Reason",
Value: "Cancelled",
ResultType: result.InternalTektonResultType,
})
e.WritePostFile(e.PostFile, ErrContextCanceled)
e.WriteExitCodeFile(e.StepMetadataDir, syscall.SIGKILL.String())

Termination Reason: Canceled
Meaning: The step was stopped by user

Should this reason also be added to the table?

@chitrangpatel
Copy link
Contributor Author

chitrangpatel commented Oct 19, 2023

Yes, it should @chengjoey!

I aded it to the table. Thanks 🙏

@pritidesai
Copy link
Member

@shankarpentyala07 PTAL at the proposed changes to surface actual termination reason, thanks!

@shankarpentyala07
Copy link
Contributor

/assign @shankarpentyala07

@renzodavid9
Copy link
Contributor

Hey @shankarpentyala07! I just wanted to check if you are actively working in this issue. If not I would be happy to help with this. Thanks a lot! 😄

@shankarpentyala07
Copy link
Contributor

Hi @renzodavid9 ,Thanks for checking.
I am yet to start working , I would be happy to work together. Shall we have one meeting and discuss the changes. My email is [email protected] , available any time apart from 9am-11am PST.

@shankarpentyala07
Copy link
Contributor

/unassign @shankarpentyala07

@shankarpentyala07
Copy link
Contributor

Hi @renzodavid9 - I have unassigned , please proceed.

@renzodavid9
Copy link
Contributor

/assign

@renzodavid9
Copy link
Contributor

Got it! Thanks @shankarpentyala07! I just assigned this

renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 17, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 17, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 17, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 17, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 17, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 27, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Nov 27, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 4, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 4, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 4, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 4, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 6, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.

Co-authored-by: JeromeJu <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 6, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.

Co-authored-by: JeromeJu <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Dec 11, 2023
Related with tektoncd#7223.

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We evaluated changing the container `reason` directly, but looks like k8s doesn't allow this.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Jan 15, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Jan 15, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Jan 22, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Jan 22, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Jan 29, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
renzodavid9 added a commit to renzodavid9/tekton-pipeline that referenced this issue Feb 5, 2024
Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
tekton-robot pushed a commit that referenced this issue Feb 7, 2024
Related with #7539 and #7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. Hacktoberfest Categorizes issue as one for Hacktoberfest 2021 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
7 participants