From 7866668cb49d5ed968ae3fb8316f1dbcd0ef4f10 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Thu, 28 Mar 2019 17:19:36 +0800 Subject: [PATCH] agent: Revert "agent: Fix container creation" This reverts commit eb4eb55f07b922a25728696011edfcd3d39e2080. To fix shimv2 tests random fails. Fixes: #502 Signed-off-by: Hui Zhu --- grpc.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/grpc.go b/grpc.go index 1021731b20..eae600d15e 100644 --- a/grpc.go +++ b/grpc.go @@ -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 ":" @@ -312,7 +312,6 @@ func buildProcess(agentProcess *pb.Process, procID string, init bool) (*process, Env: agentProcess.Env, User: user, AdditionalGroups: additionalGids, - Init: init, }, } @@ -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 } @@ -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 }