Skip to content

Commit

Permalink
agent: Revert "agent: Fix container creation"
Browse files Browse the repository at this point in the history
This reverts commit eb4eb55.
To fix shimv2 tests random fails.

Fixes: kata-containers#502

Signed-off-by: Hui Zhu <teawater@hyper.sh>
  • Loading branch information
teawater committed Mar 28, 2019
1 parent 8f893b9 commit 7866668
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func setConsoleCarriageReturn(fd int) error {
return unix.IoctlSetTermios(fd, unix.TCSETS, termios)
}

func buildProcess(agentProcess *pb.Process, procID string, init bool) (*process, error) {
func buildProcess(agentProcess *pb.Process, procID string) (*process, error) {
user := agentProcess.User.Username
if user == "" {
// We can specify the user and the group separated by ":"
Expand All @@ -312,7 +312,6 @@ func buildProcess(agentProcess *pb.Process, procID string, init bool) (*process,
Env: agentProcess.Env,
User: user,
AdditionalGroups: additionalGids,
Init: init,
},
}

Expand Down Expand Up @@ -584,7 +583,7 @@ func (a *agentGRPC) finishCreateContainer(ctr *container, req *pb.CreateContaine
}
ctr.config = *config

ctr.initProcess, err = buildProcess(req.OCI.Process, req.ExecId, true)
ctr.initProcess, err = buildProcess(req.OCI.Process, req.ExecId)
if err != nil {
return emptyResp, err
}
Expand Down Expand Up @@ -875,7 +874,7 @@ func (a *agentGRPC) ExecProcess(ctx context.Context, req *pb.ExecProcessRequest)
return nil, grpcStatus.Errorf(codes.FailedPrecondition, "Cannot exec in stopped container %s", req.ContainerId)
}

proc, err := buildProcess(req.Process, req.ExecId, false)
proc, err := buildProcess(req.Process, req.ExecId)
if err != nil {
return emptyResp, err
}
Expand Down

0 comments on commit 7866668

Please sign in to comment.