Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't return PIDs inside micro VMs #236

Merged
merged 1 commit into from
Jul 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
// secure randomness
"math/rand" // #nosec

"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/events/exchange"
"github.com/containerd/containerd/log"
Expand Down Expand Up @@ -983,13 +984,12 @@ func (s *service) Checkpoint(requestCtx context.Context, req *taskAPI.Checkpoint
func (s *service) Connect(requestCtx context.Context, req *taskAPI.ConnectRequest) (*taskAPI.ConnectResponse, error) {
defer logPanicAndDie(log.G(requestCtx))

log.G(requestCtx).WithField("task_id", req.ID).Debug("connect")
resp, err := s.agentClient.Connect(requestCtx, req)
if err != nil {
return nil, err
}
// Since task_pid inside the micro VM wouldn't make sense for clients,
// we intentionally return ErrNotImplemented instead of forwarding that to the guest-side shim.
// https://github.com/firecracker-microvm/firecracker-containerd/issues/210
log.G(requestCtx).WithField("task_id", req.ID).Error(`"connect" is not implemented by the shim`)

return resp, nil
return nil, errdefs.ErrNotImplemented
}

// Shutdown will attempt a graceful shutdown of the shim+VM. The shutdown procedure will only actually take
Expand Down