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

Enhance the output of the kubectl get taskruns #615

Closed
skeeey opened this issue Mar 13, 2019 · 14 comments
Closed

Enhance the output of the kubectl get taskruns #615

skeeey opened this issue Mar 13, 2019 · 14 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@skeeey
Copy link

skeeey commented Mar 13, 2019

Expected Behavior

When I execute kubectl get taskruns command, I want to get more helpful information about the taskruns

e.g.

  • TaskRun.Status.StartTime
  • TaskRun.Status.CompletionTime
  • TaskRun.Status.Conditions.Type
  • TaskRun.Status.Conditions.Status
  • TaskRun.Status.Conditions.Reason

Actual Behavior

When I execute kubectl get taskruns command, I don't get any helpful information

@skeeey
Copy link
Author

skeeey commented Mar 13, 2019

If this make sense, I can send out a PR to fix this

@bobcatfish
Copy link
Collaborator

Hey there @skeeey ! Trying to make sure I know what's missing: so when I run kubectl get taskruns -o yaml I seem to be seeing the info you're looking for, e.g.:

status:
  conditions:
    - lastTransitionTime: 2018-12-11T15:50:09Z
      status: "True"
      type: Succeeded
  podName: echo-hello-world-task-run-pod-85ca51
  startTime: 2018-12-11T15:49:39Z
  steps:
    - terminated:
        containerID: docker://fcfe4a004...6729d6d2ad53faff41
        exitCode: 0
        finishedAt: 2018-12-11T15:50:01Z
        reason: Completed
        startedAt: 2018-12-11T15:50:01Z
    - terminated:
        containerID: docker://fe86fc5f7...eb429697b44ce4a5b
        exitCode: 0
        finishedAt: 2018-12-11T15:50:02Z
        reason: Completed
        startedAt: 2018-12-11T15:50:02Z

(I took this example output from https:/tektoncd/pipeline/blob/master/docs/tutorial.md#task)

So we've got:

  • TaskRun.Status.StartTime
  • TaskRun.Status.CompletionTime is technically: TaskRun.Status.Conditions[0].LastTransitionTime
  • TaskRun.Status.Conditions.Type is technically: TaskRun.Status.Conditions[0].Type
  • TaskRun.Status.Conditions.Status is technically: TaskRun.Status.Conditions[0].Status
  • TaskRun.Status.Conditions.Reason is in the status of each step (note that Taskruns: hard to follow steps status of a task #549 proposes adding names to these step statuses so they're easier to read)

Is that the info you're looking for?

(Note that some of this is not super intuitive b/c it's trying to follow these kubernetes api best practices: https:/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties)

@skeeey
Copy link
Author

skeeey commented Mar 14, 2019

Hi @bobcatfish, maybe my description is not clear :), in fact, I want to get some basic info from kubectl get taskruns directly, e.g.

$ kubectl get taskruns

##  Expected output
NAME  TYPE        STATUS  STARTTTIME               COMPLETIONTIME           Reason
hello1  Succeeded  Ture    2019-03-12T08:09:11Z     2019-03-12T08:09:24Z
hello2  Succeeded  Ture    2019-03-12T08:10:12Z     2019-03-12T08:09:30Z   

## Current output
NAME  AGE
hello1   1d
hello2   1d

I think I can quickly glance the taskrun status from expected output and we can also use --watch to monitor their status changed, currently, I must use -o yaml and go through the yaml file to find the taskrun status, I think this is not convenient, what do you think?

@vdemeester
Copy link
Member

/good-first-issue
/enhancement
/help-wanted

@tekton-robot
Copy link
Collaborator

@vdemeester:
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
/enhancement
/help-wanted

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 good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 14, 2019
@vdemeester
Copy link
Member

/kind enhancement

@vdemeester
Copy link
Member

/assign @chmouel

@tekton-robot
Copy link
Collaborator

@vdemeester: GitHub didn't allow me to assign the following users: chmouel.

Note that only tektoncd members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

/assign @chmouel

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.

@abayer
Copy link
Contributor

abayer commented Mar 14, 2019

If we're going to do this for TaskRuns, it'd make sense to do it for PipelineRuns at the same time.

@bobcatfish
Copy link
Collaborator

ohhh that makes perfect sense, thanks for the extra details @skeeey !!! ❤️ ❤️❤️

@dlorenc
Copy link
Contributor

dlorenc commented Mar 21, 2019

It looks like the right way to do this might be with "Additional Printer Columns":
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#additional-printer-columns

@dlorenc
Copy link
Contributor

dlorenc commented Mar 21, 2019

@chmouel are you still hoping to do this?

@girishramnani
Copy link
Contributor

girishramnani commented Mar 28, 2019

I can work on this @dlorenc, I have this much output working.

$ kubectl get taskruns
NAME                        TYPE        STATUS    STARTTIME   COMPLETIONTIME
echo-hello-world-task-run   Succeeded   True      21h         21h

I am not sure how to get reason out of all the steps. maybe adding an extra field called AggregateReasons which holds all the reasons as a comma separated string in the TaskRunStatus struct can be a possibility @dlorenc

girishramnani added a commit to girishramnani/pipeline that referenced this issue Mar 28, 2019
Added type, status, startTime and CompletionTime as additional
printer columns in taskrun. This will show the above fields when
someone does kubectl get taskruns.
Fixes tektoncd#615
@girishramnani
Copy link
Contributor

Opened a PR for this #694

tekton-robot pushed a commit that referenced this issue Mar 29, 2019
Added type, status, startTime and CompletionTime as additional
printer columns in taskrun. This will show the above fields when
someone does kubectl get taskruns.
Fixes #615
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. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

No branches or pull requests

7 participants