Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix index out of range error when no timestamp in log
PR ansible#1187 introduced a situation that causes ``` panic: runtime error: index out of range [1] with length 1 goroutine 534519 [running]: github.com/ansible/receptor/pkg/workceptor.(*KubeUnit).kubeLoggingWithReconnect(0xc001506b00, 0xc004a97400?, 0xc009cb9fd0?, 0xc00cd1d510, 0xc00cd1d520) /Users/haoli/projects/src/github.com/TheRealHaoLiu/receptor/pkg/workceptor/kubernetes.go:395 +0x108b created by github.com/ansible/receptor/pkg/workceptor.(*KubeUnit).runWorkUsingLogger /Users/haoli/projects/src/github.com/TheRealHaoLiu/receptor/pkg/workceptor/kubernetes.go:834 +0xc5e ``` This PR will write the whole line into stdout if first word in the log is not an timestamp This can both prevent the index out of range error and allow us to record the line in stdout to aid further debugging of this issue. Co-Authored-By: Matthew Sandoval <[email protected]>
- Loading branch information