Skip to content

Commit e6a93f2

Browse files
committed
fix terminal command make panic due to index out of range
1 parent 2c263a5 commit e6a93f2

File tree

1 file changed

+3
-0
lines changed
  • internal/tools/orchestrator/scheduler/executor/plugins/k8s

1 file changed

+3
-0
lines changed

internal/tools/orchestrator/scheduler/executor/plugins/k8s/terminal.go

+3
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ func (k *Kubernetes) Terminal(namespace, podname, containername string, upperCon
178178
case <-ctx.Done():
179179
return
180180
case command := <-commandChan:
181+
if len(command) == 0 {
182+
continue
183+
}
181184
buf.WriteString(command)
182185
var writeCommand bool
183186
if command[len(command)-1] == '\r' {

0 commit comments

Comments
 (0)