Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 4, 2020 06:12
Show Gist options
  • Select an option

  • Save ihcsim/a048e24fac5fc6a9f1a46bcce19b099d to your computer and use it in GitHub Desktop.

Select an option

Save ihcsim/a048e24fac5fc6a9f1a46bcce19b099d to your computer and use it in GitHub Desktop.
// InstallDebuggingHandlers registers the HTTP request patterns that serve logs or run commands/containers
func (s *Server) InstallDebuggingHandlers(criHandler http.Handler) {
// ...
ws = new(restful.WebService)
ws.
Path("/exec")
ws.Route(ws.GET("/{podNamespace}/{podID}/{containerName}").
To(s.getExec).
Operation("getExec"))
ws.Route(ws.POST("/{podNamespace}/{podID}/{containerName}").
To(s.getExec).
Operation("getExec"))
ws.Route(ws.GET("/{podNamespace}/{podID}/{uid}/{containerName}").
To(s.getExec).
Operation("getExec"))
ws.Route(ws.POST("/{podNamespace}/{podID}/{uid}/{containerName}").
To(s.getExec).
Operation("getExec"))
s.restfulCont.Add(ws)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment