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

Add Check in PipelineRun Logs for if Condition Available #471

Merged
merged 1 commit into from
Nov 21, 2019
Merged

Add Check in PipelineRun Logs for if Condition Available #471

merged 1 commit into from
Nov 21, 2019

Conversation

danielhelfand
Copy link
Member

Closes #470

This pull request adds checks for if the conditions are available in the logs of a pipeline run to help prevent the index from being out of range.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Regenerate the manpages and docs with make docs and make man if needed.
  • Run the code checkers with make check
  • Commit messages follow commit message best practices

Release Notes

Check if conditions are available in pipelinerun logs to prevent index from condition list from being out of range

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 18, 2019
@danielhelfand danielhelfand changed the title add check in pr logs for if condition available Add Check in PipelineRun Logs for if Condition Available Nov 18, 2019
@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/log_reader.go 90.7% 89.7% -1.0

@@ -213,5 +212,10 @@ func pipeLogs(logC chan<- Log, errC chan<- error, tlr *taskrun.LogReader) {
}

func empty(status v1alpha1.PipelineRunStatus) bool {

if status.Status.Conditions == nil {
Copy link
Contributor

@piyush-garg piyush-garg Nov 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be status.Status == nil according to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status.Status is a struct so it can't be nil (i.e. cannot convert nil to type "knative.dev/pkg/apis/duck/v1beta1".Status). Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I mean status.Conditions == nil

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good catch. I pushed up a change for it. Thanks.

@chmouel
Copy link
Member

chmouel commented Nov 20, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 20, 2019
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2019
@tekton-robot
Copy link
Contributor

The following is the coverage report on pkg/.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/log_reader.go 90.7% 89.7% -1.0

Copy link
Contributor

@piyush-garg piyush-garg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2019
@chmouel
Copy link
Member

chmouel commented Nov 21, 2019

/lgtm
/approve
/meow

Thanks 🙇🏽‍♂️😻

@tekton-robot
Copy link
Contributor

@chmouel: cat image

In response to this:

/lgtm
/approve
/meow

Thanks 🙇🏽‍♂️😻

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chmouel, piyush-garg

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 21, 2019
@tekton-robot tekton-robot merged commit d382739 into tektoncd:master Nov 21, 2019
@danielhelfand danielhelfand deleted the check_pr_cond branch November 21, 2019 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tkn logs segfaults if run not started
5 participants