-
Notifications
You must be signed in to change notification settings - Fork 252
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
Resolved the different log output issue for tkn p logs
and tkn pr logs
.
#2235
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Senjuti256. 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. |
tkn p logs
and tkn pr logs
.tkn p logs
and tkn pr logs
.
pkg/cmd/pipeline/logs.go
Outdated
@@ -95,8 +95,10 @@ Show logs for given Pipeline and PipelineRun: | |||
c.Flags().BoolVarP(&opts.Last, "last", "L", false, "show logs for last PipelineRun") | |||
c.Flags().BoolVarP(&opts.AllSteps, "all", "a", false, "show all logs including init steps injected by tekton") | |||
c.Flags().BoolVarP(&opts.Follow, "follow", "f", false, "stream live logs") | |||
c.Flags().BoolVarP(&opts.Timestamps, "timestamps", "t", false, "show logs with timestamp") | |||
c.Flags().BoolVarP(&opts.Timestamps, "timestamps", "", false, "show logs with timestamp") |
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.
This is breaking change
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.
Should I remove the functionality of filtering out and printing only the mentioned tasks? If not then what flag should I use for it @piyush-garg ?
pkg/cmd/pipeline/logs.go
Outdated
c.Flags().IntVarP(&opts.Limit, "limit", "", 5, "lists number of PipelineRuns") | ||
c.Flags().BoolVarP(&opts.Prefixing, "prefix", "", true, "prefix each log line with the log source (task name and step name)") | ||
c.Flags().StringSliceVarP(&opts.Tasks, "task", "t", []string{}, "show logs for mentioned Tasks only") |
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.
why do we need this flag? is this a related change?
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.
@vinamra28 Are you talking about the line no. 101 ? I added that in order to ensure that we can filter out and show logs for a specific/required task only. This functionality exists in tkn pr logs
. Now that we are formatting the output of tkn p logs
to look like tkn pr logs
I felt that this functionality should also be there else the logs for both the commands might be different in some cases.
/ok-to-test |
/retest |
@Senjuti256 Can you please add some tests for it? |
/retest |
@Senjuti256: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Changes
Added additional formatting options such as --prefix for
tkn p logs
, which prefixes each log line with the task name and step name to match the output format oftkn pr logs
. This is done to resolve issue #2223 .Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
See the contribution guide
for more details.
Release Notes