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

tkn logs segfaults if run not started #470

Closed
faust64 opened this issue Nov 18, 2019 · 5 comments · Fixed by #471
Closed

tkn logs segfaults if run not started #470

faust64 opened this issue Nov 18, 2019 · 5 comments · Fixed by #471
Assignees

Comments

@faust64
Copy link

faust64 commented Nov 18, 2019

Expected Behavior

Some info/error/warning, notifying me the job has not started yet

Actual Behavior

$ tkn pipelinerun list
NAME                              STARTED        DURATION     STATUS      
....
nextcloud-wsweet-master-1         ---            ---          ---         
...
$ tkn pipelinerun logs nextcloud-wsweet-master-1
panic: runtime error: index out of range [0] with length 0

goroutine 34 [running]:
github.com/tektoncd/cli/pkg/cmd/pipelinerun.(*LogReader).readAvailableLogs.func1(0xc000772000, 0xc000772060, 0x23cb680, 0x0, 0x0, 0xc000200720, 0xc0000e0a00)
	/workspace/src/github.com/tektoncd/cli/pkg/cmd/pipelinerun/log_reader.go:137 +0x3a5
created by github.com/tektoncd/cli/pkg/cmd/pipelinerun.(*LogReader).readAvailableLogs
	/workspace/src/github.com/tektoncd/cli/pkg/cmd/pipelinerun/log_reader.go:126 +0x2e1

Steps to Reproduce the Problem

  1. pile up several pipelineruns
  2. use tkn pipelinerun logs against a job that did not start
@piyush-garg
Copy link
Contributor

@faust64 Can you please provide the CLI version also? tkn version

@danielhelfand
Copy link
Member

My thought is we need to check if conditions are available. We need to use the empty func to check before using index 0 for the conditions list.

@piyush-garg
Copy link
Contributor

Yes, exactly. I also ended up with the same resolution. Are you raising the PR or should I ?

@danielhelfand
Copy link
Member

/assign

I'll raise one.

@faust64
Copy link
Author

faust64 commented Nov 19, 2019

Hi,

CLI version: 0.5.0

$ tkn version
Client version: 0.5.0

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants