We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当我成功连接到k8s集群之后,发送一个请求会出现下面错误: { "type": "stdout", "data": "exit\r\n", "cols": 0, "rows": 0 } 和 E0727 11:09:46.370144 29472 v2.go:104] write tcp xx.xx.xx:61184->xx.xx.xx.xx:443: use of closed network connection
自己的代码: conn, err :=websocket.Upgrade(c.Writer,` c.Request, nil, 1024, 1024) if err != nil { fmt.Println("Upgrade", err) c.AbortWithStatusJSON(http.StatusOK, gin.H{"code": http.StatusInternalServerError, "msg": err.Error()}) return }
conn, err :=
// 通过 集群名称获取config config, err := common.Getk8sclusterConfig(params.ClusterName) config.ContentConfig.GroupVersion = &v1.Unversioned config.ContentConfig.NegotiatedSerializer = scheme.Codecs if err != nil { elog.Errorw("ContainerExec", "config", err) // c.JSONE(core.CodeErr, "cluster not found", nil) return } wsTransport := transport.NewWSTransport(conn) tml, err := terminal.NewWebTerminal(config, params.Namespace, params.PodName, params.ContainerName, wsTransport) if err != nil { elog.Errorw("ContainerExec", "terminal", err) _, _ = wsTransport.Write([]byte("连接终端失败,该Pod可能已经下线\n" + err.Error())) return } err = tml.Run() if err != nil { elog.Errorw("ContainerExec", "run", err) _, _ = wsTransport.Write([]byte("连接终端失败:" + err.Error())) return }
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当我成功连接到k8s集群之后,发送一个请求会出现下面错误:
{
"type": "stdout",
"data": "exit\r\n",
"cols": 0,
"rows": 0
}
和
E0727 11:09:46.370144 29472 v2.go:104] write tcp xx.xx.xx:61184->xx.xx.xx.xx:443: use of closed network connection
自己的代码:
conn, err :=
websocket.Upgrade(c.Writer,` c.Request, nil, 1024, 1024)if err != nil {
fmt.Println("Upgrade", err)
c.AbortWithStatusJSON(http.StatusOK, gin.H{"code": http.StatusInternalServerError, "msg": err.Error()})
return
}
`
The text was updated successfully, but these errors were encountered: