cri-o/server
Antonio Murdaca 1e9ef65345
server: fix PortForward panic
During "Port forwarding" e2e tests, the following panic happened:

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x64981d]

goroutine 52788 [running]:
panic(0x1830ee0, 0xc4200100c0)
        /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/kubernetes-incubator/cri-o/oci.(*Runtime).UpdateStatus(0xc4202afc00,
0x0, 0x0, 0x0)
        /home/amurdaca/go/src/github.com/kubernetes-incubator/cri-o/oci/oci.go:549
+0x7d
github.com/kubernetes-incubator/cri-o/server.streamService.PortForward(0xc42026e000,
0x0, 0x0, 0x0, 0x0, 0xc420d9af40, 0x40, 0xc400000050, 0x7fe660659a28,
0xc4201cd0e0, ...)
```

The issue is `streamService.PortForward` assumed the first argument to
be the sandbox's infra container ID, thus trying to get it from memory
store using `.state.containers.Get`. Since that ID is of the sandbox
itself, it fails to get the container object from memory and panics in
`UpdateStatus`.

Fix it by looking for the sandbox's infra container ID starting from a
sandbox ID.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-05-28 18:22:46 +02:00
..
apparmor Rename ocid to crio. 2017-05-12 09:56:06 -04:00
seccomp Update runtime-spec to v1.0.0.rc5 2017-04-12 19:15:53 -07:00
config.go Rename ocid to crio. 2017-05-12 09:56:06 -04:00
container.go Applying k8s.io v3 API for ocic and ocid 2017-02-06 13:05:10 +01:00
container_attach.go server: split containers actions 2016-11-22 18:38:05 +01:00
container_create.go server: store and use image's stop signal to stop containers 2017-05-27 10:21:04 +02:00
container_exec.go Fix terminal resize handling so kubectl exec -i -t sh works 2017-04-24 18:44:49 +02:00
container_execsync.go Applying k8s.io v3 API for ocic and ocid 2017-02-06 13:05:10 +01:00
container_list.go server: remove Update calls 2017-04-27 14:01:37 +02:00
container_portforward.go server: fix PortForward panic 2017-05-28 18:22:46 +02:00
container_remove.go server: honor container stop timeout from CRI 2017-05-15 22:56:31 +02:00
container_start.go server: store containers state on disk 2017-05-18 21:19:50 +02:00
container_status.go Set Container Status Reason when OOM Killed 2017-05-25 11:30:58 -07:00
container_stop.go server: store containers state on disk 2017-05-18 21:19:50 +02:00
container_updateruntimeconfig.go server: mock UpdateRuntimeConfig 2016-12-15 14:31:42 +01:00
image_list.go server: readable fields 2017-04-20 08:22:50 -04:00
image_pull.go server: readable fields 2017-04-20 08:22:50 -04:00
image_remove.go server: readable fields 2017-04-20 08:22:50 -04:00
image_status.go server: container_status: we should return digested references in imageRef 2017-05-22 16:37:46 +02:00
runtime_status.go Applying k8s.io v3 API for ocic and ocid 2017-02-06 13:05:10 +01:00
sandbox.go server: store creation in containers 2017-05-18 18:49:54 +02:00
sandbox_list.go server: ignore runc not exist errors 2017-05-18 21:19:50 +02:00
sandbox_remove.go server: sandbox_remove: add comment on sandbox not found empty response 2017-05-22 16:38:10 +02:00
sandbox_run.go server: store and use image's stop signal to stop containers 2017-05-27 10:21:04 +02:00
sandbox_status.go server: ignore runc not exist errors 2017-05-18 21:19:50 +02:00
sandbox_stop.go server: sandbox_stop: ignore not found sandboxes 2017-05-22 16:37:39 +02:00
server.go server: fix PortForward panic 2017-05-28 18:22:46 +02:00
utils.go Applying k8s.io v3 API for ocic and ocid 2017-02-06 13:05:10 +01:00
version.go Applying k8s.io v3 API for ocic and ocid 2017-02-06 13:05:10 +01:00