refactor kubectl websocket API

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-11-07 12:40:44 +08:00
parent 5cc4169244
commit 2c52a7064c
102 changed files with 853 additions and 16388 deletions

View File

@@ -42,14 +42,11 @@ func addWebService(c *restful.Container) error {
tags := []string{"Terminal"}
webservice.Route(webservice.GET("/namespaces/{namespace}/pods/{pod}").
To(terminal.CreateTerminalSession).
To(terminal.HandleTerminalSession).
Doc("create terminal session").
Metadata(restfulspec.KeyOpenAPITags, tags).
Writes(models.PodInfo{}))
path := runtime.ApiRootPath + "/" + GroupVersion.String() + "/sockjs"
c.Handle(path+"/", terminal.NewTerminalHandler(path))
c.Add(webservice)
return nil