@@ -117,7 +117,7 @@ func ReadLogs(appName string, podSearchLabels map[string]string, verbose bool, s
117
117
}
118
118
119
119
if ! wrotePending {
120
- if ! writeSocket ("\n Pending" , socket ) {
120
+ if ! writeSocket ("\n Pending... " , socket ) {
121
121
return
122
122
}
123
123
wrotePending = true
@@ -138,9 +138,10 @@ func getKubectlLogs(pods []kcore.Pod, verbose bool, wrotePending bool, previous
138
138
}
139
139
140
140
if isAllPending {
141
- if ! writeSocket ("\n Pending" , socket ) {
141
+ if ! writeSocket ("\n Pending... " , socket ) {
142
142
return
143
143
}
144
+ wrotePending = true
144
145
}
145
146
}
146
147
@@ -154,7 +155,7 @@ func getKubectlLogs(pods []kcore.Pod, verbose bool, wrotePending bool, previous
154
155
podCheckCancel := make (chan struct {})
155
156
defer close (podCheckCancel )
156
157
157
- go podCheck (podCheckCancel , socket , pods , previous , verbose , inr )
158
+ go podCheck (podCheckCancel , socket , pods , previous , verbose , wrotePending , inr )
158
159
pumpStdin (socket , inw )
159
160
podCheckCancel <- struct {}{}
160
161
}
@@ -186,7 +187,7 @@ func startKubectlProcess(pod kcore.Pod, previous bool, attrs *os.ProcAttr) (*os.
186
187
return process , nil
187
188
}
188
189
189
- func podCheck (podCheckCancel chan struct {}, socket * websocket.Conn , initialPodList []kcore.Pod , previous bool , verbose bool , inr * os.File ) {
190
+ func podCheck (podCheckCancel chan struct {}, socket * websocket.Conn , initialPodList []kcore.Pod , previous bool , verbose bool , wrotePending bool , inr * os.File ) {
190
191
timer := time .NewTimer (0 )
191
192
defer timer .Stop ()
192
193
@@ -266,6 +267,13 @@ func podCheck(podCheckCancel chan struct{}, socket *websocket.Conn, initialPodLi
266
267
maxPodsToAdd = len (podsToAdd )
267
268
}
268
269
270
+ if wrotePending && len (latestRunningPods ) > 0 {
271
+ if ! writeSocket ("Streaming logs:" , socket ) {
272
+ return
273
+ }
274
+ wrotePending = false
275
+ }
276
+
269
277
for _ , podName := range podsToAdd [:maxPodsToAdd ] {
270
278
process , err := startKubectlProcess (latestRunningPodsMap [podName ], previous , & os.ProcAttr {
271
279
Files : []* os.File {inr , outw , outw },
@@ -453,10 +461,6 @@ func extractFromCortexLog(match string, loglevel string, logStr string) (*string
453
461
return formatHeader3 (cutStr ), false
454
462
}
455
463
456
- if strings .HasPrefix (cutStr , "Serving model" ) {
457
- return formatHeader3 (cutStr ), false
458
- }
459
-
460
464
if strings .HasPrefix (cutStr , "Prediction failed" ) {
461
465
return formatHeader2 (cutStr ), false
462
466
}
0 commit comments