MCPcopy Index your code
hub / github.com/1Panel-dev/KubePi / WaitForNodeShellTerminal

Function WaitForNodeShellTerminal

pkg/terminal/shell.go:319–334  ·  view source on GitHub ↗

node shell

(k8sClient kubernetes.Interface, cfg *rest.Config,nodeName string, sessionId string)

Source from the content-addressed store, hash-verified

317
318//node shell
319func WaitForNodeShellTerminal(k8sClient kubernetes.Interface, cfg *rest.Config,nodeName string, sessionId string) {
320 select {
321 case <-TerminalSessions.Get(sessionId).Bound:
322 close(TerminalSessions.Get(sessionId).Bound)
323
324 err := startNodeShellProcess(k8sClient, cfg, nodeName, TerminalSessions.Get(sessionId))
325
326
327 if err != nil {
328 TerminalSessions.Close(sessionId, 2, err.Error())
329 return
330 }
331
332 TerminalSessions.Close(sessionId, 1, "Process exited")
333 }
334}
335func startNodeShellProcess(k8sClient kubernetes.Interface, cfg *rest.Config, nodeName string, ptyHandler PtyHandler) error {
336
337 /*创建特权容器*/

Callers 1

Calls 4

startNodeShellProcessFunction · 0.85
ErrorMethod · 0.80
GetMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected