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

Support limiting to a specific container when running logs #578

Closed
chmouel opened this issue Jan 7, 2020 · 9 comments · Fixed by #694
Closed

Support limiting to a specific container when running logs #578

chmouel opened this issue Jan 7, 2020 · 9 comments · Fixed by #694
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@chmouel
Copy link
Member

chmouel commented Jan 7, 2020

Expected Behavior

Currently we are showing the logs from all containers, it would be nice if we can limit to loging to only a step/container for tkn taskrun or to a specic taskrun in tkn pipelinerun

Actual Behavior

Showing everything

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 7, 2020
@piyush-garg
Copy link
Contributor

/assign

@piyush-garg
Copy link
Contributor

  • step flag for the logs of the specific steps in the taskrun.

For specific taskrun of a pipelinerun, we already have --only-tasks flag to specify the tasks for which you want the logs.

cc @chmouel

@chmouel
Copy link
Member Author

chmouel commented Jan 8, 2020

do we have?

image

@piyush-garg
Copy link
Contributor

I mean we have a flag --only-tasks to show the logs for only tasks mentioned in pipelinerun logs command, but the --only-steps flag to show the logs for only steps mentioned in taskrun logs is what needs to be added.

$ tkn pr logs -h
Show the logs of PipelineRun

Usage:
tkn pipelinerun logs

Examples:
  Show the logs of PipelineRun named 'foo' from namespace 'bar':

    tkn pipelinerun logs foo -n bar

Show the logs of PipelineRun named 'microservice-1' for task 'build' only from namespace 'bar':

    tkn pr logs microservice-1 -t build -n bar

Show the logs of PipelineRun named 'microservice-1' for all tasks and steps (including init steps) from namespace 'foo':

    tkn pr logs microservice-1 -a -n foo
   

Flags:
  -a, --all                  show all logs including init steps injected by tekton
  -f, --follow               stream live logs
  -h, --help                 help for logs
      --limit int            lists number of pipelineruns (default 5)
  -t, --only-tasks strings   show logs for mentioned tasks only

Global Flags:
  -c, --context string      name of the kubeconfig context to use (default: kubectl config current-context)
  -k, --kubeconfig string   kubectl config file (default: $HOME/.kube/config)
  -n, --namespace string    namespace to use (default: from $KUBECONFIG)
  -C, --nocolour            disable colouring (default: false)

@chmouel
Copy link
Member Author

chmouel commented Jan 8, 2020 via email

@vdemeester
Copy link
Member

right, I would naively think of --task … and --step … 👼
/cc @danielhelfand

@piyush-garg
Copy link
Contributor

To me also --tasks and --steps looks better wrt naming and understanding

@danielhelfand
Copy link
Member

We could potentially allow multiple --step/--task flags to specify which logs you would like included from a pipelinerun or taskrun:

tkn pipelinerun logs run --task foo --task bar

tkn taskrun logs run --step foo --step bar

@chmouel
Copy link
Member Author

chmouel commented Jan 8, 2020

@danielhelfand your suggestion sounds good to me!

piyush-garg added a commit to piyush-garg/cli that referenced this issue Feb 10, 2020
This will add --step flag for taskrun logs to
show logs of respective tasks only

Rename --only-tasks to --task in pipelinerun
logs

Add tests and docs

Fix tektoncd#578
tekton-robot pushed a commit that referenced this issue Feb 10, 2020
This will add --step flag for taskrun logs to
show logs of respective tasks only

Rename --only-tasks to --task in pipelinerun
logs

Add tests and docs

Fix #578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants