(spec *xray.NodeSpec, prev bool)
| 313 | } |
| 314 | |
| 315 | func (x *Xray) showLogs(spec *xray.NodeSpec, prev bool) { |
| 316 | // Need to load and wait for pods |
| 317 | path, co := spec.Path(), "" |
| 318 | if spec.GVR() == client.CoGVR { |
| 319 | _, coName := client.Namespaced(spec.Path()) |
| 320 | path, co = *spec.ParentPath(), coName |
| 321 | } |
| 322 | |
| 323 | ns, _ := client.Namespaced(path) |
| 324 | _, err := x.app.factory.CanForResource(ns, client.PodGVR, client.ListAccess) |
| 325 | if err != nil { |
| 326 | x.app.Flash().Err(err) |
| 327 | return |
| 328 | } |
| 329 | |
| 330 | opts := dao.LogOptions{ |
| 331 | Path: path, |
| 332 | Container: co, |
| 333 | Previous: prev, |
| 334 | } |
| 335 | if err := x.app.inject(NewLog(client.PodGVR, &opts), false); err != nil { |
| 336 | x.app.Flash().Err(err) |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | func (x *Xray) shellCmd(*tcell.EventKey) *tcell.EventKey { |
| 341 | spec := x.selectedSpec() |
no test coverage detected