-
Notifications
You must be signed in to change notification settings - Fork 249
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
Bugfix Returns an error if no pipelines found #194
Conversation
Returns an error with proper message if no pipelines found Adds example message Adds test for no pipelines Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
/ok-to-test |
The following is the coverage report on pkg/.
|
@@ -53,15 +53,25 @@ func logCommand(p cli.Params) *cobra.Command { | |||
} | |||
|
|||
eg := ` | |||
# show the logs of the latest pipelinerun of given pipeline | |||
tkn pipeline logs foo -n bar | |||
# show logs interactively for no inputs |
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 needs to rephrased, how about: "interactive mode: shows log of the selected pipeline run"
|
||
# show logs interactively for given pipeline |
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.
same as above: "interactive mode: shows log of the pipeline-run of the given pipeline"
tkn pipeline logs pipeline_name -n namespace | ||
|
||
# show logs of given pipeline for last run | ||
tkn pipeline logs pipeline_name -n namespace --last |
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.
I prefer pipeline
to pipeline_name
as a pipeline is known by its name - right?
@@ -193,7 +203,9 @@ func allPipelines(p cli.Params) ([]string, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
if len(ps.Items) == 0 { |
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.
in an interactive mode, why is this an error? if the user has not specified a pipeline
then this shouldn't be an error.
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.
I think,
-
tkn p logs -n ns
should not return an error when there are no pipelines -
tkn p logs -n ns pipeline
should return an error if the thepipeline
cannot be found -
tkn p logs -n ns pipeline
should not return an error if thepipeline
exits but there aren't any pipeline-runs; just show a message "no pipeline runs found for pipeline" -
tkn p logs -n ns pipeline -l
should return an error if thepipeline
exits but there aren't any pipeline-runs as the user has requested for thelast
pipelinerun which does not exist
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pradeepitm12, vdemeester 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 |
Returns an error with proper message if no pipelines found
Adds example message
Adds test for no pipelines
Signed-off-by: Pradeep Kumar pradkuma@redhat.com
Changes
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.
Release Notes