Skip to content

Commit

Permalink
container_portforward: add support for short pod IDs
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed Jun 13, 2018
1 parent 4774d94 commit 7cdbd3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/container_portforward.go
Expand Up @@ -33,7 +33,11 @@ func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (r
}

func (ss streamService) PortForward(podSandboxID string, port int32, stream io.ReadWriteCloser) error {
c := ss.runtimeServer.GetSandboxContainer(podSandboxID)
sandboxID, err := ss.runtimeServer.PodIDIndex().Get(podSandboxID)
if err != nil {
return fmt.Errorf("PodSandbox with ID starting with %s not found: %v", podSandboxID, err)
}
c := ss.runtimeServer.GetSandboxContainer(sandboxID)

if c == nil {
return fmt.Errorf("could not find container for sandbox %q", podSandboxID)
Expand Down

0 comments on commit 7cdbd3b

Please sign in to comment.