(k8sClient kubernetes.Interface, namespace string, pod string, container string, tailLines int, follow bool, previous bool , timestamps bool,sessionId string)
| 106 | } |
| 107 | |
| 108 | func WaitForLoggingStream(k8sClient kubernetes.Interface, namespace string, pod string, container string, tailLines int, follow bool, previous bool , timestamps bool,sessionId string) { |
| 109 | select { |
| 110 | case <-LogSessions.Get(sessionId).Bound: |
| 111 | close(LogSessions.Get(sessionId).Bound) |
| 112 | err := startLogProcess(k8sClient, namespace, pod, container, int64(tailLines), follow, previous,timestamps, LogSessions.Get(sessionId)) |
| 113 | if err != nil { |
| 114 | LogSessions.Close(sessionId, err.Error(), 2) |
| 115 | return |
| 116 | } |
| 117 | LogSessions.Close(sessionId, "Process exited", 1) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func startLogProcess(k8sClient kubernetes.Interface, namespace string, pod string, container string, tailLines int64, follow bool, previous bool,timestamps bool,session LogSession) error { |
| 122 | reader, err := k8sClient.CoreV1(). |
no test coverage detected