From ea4b6fa55d381ba81cb525010bba8aee6245862c Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 14 Aug 2017 16:32:27 -0700 Subject: [PATCH] container: Reduce number of calls to UpdateStatus Signed-off-by: Mrunal Patel --- server/container_create.go | 4 ---- server/container_remove.go | 4 ---- server/container_stop.go | 3 --- 3 files changed, 11 deletions(-) diff --git a/server/container_create.go b/server/container_create.go index 2e23445b..a7e1f414 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -334,10 +334,6 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq return nil, err } - if err = s.Runtime().UpdateStatus(container); err != nil { - return nil, err - } - s.addContainer(container) if err = s.CtrIDIndex().Add(containerID); err != nil { diff --git a/server/container_remove.go b/server/container_remove.go index 08fe8e40..1464dade 100644 --- a/server/container_remove.go +++ b/server/container_remove.go @@ -20,10 +20,6 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq return nil, err } - if err := s.Runtime().UpdateStatus(c); err != nil { - return nil, fmt.Errorf("failed to update container state: %v", err) - } - cState := s.Runtime().ContainerStatus(c) if cState.Status == oci.ContainerStateCreated || cState.Status == oci.ContainerStateRunning { if err := s.Runtime().StopContainer(c, -1); err != nil { diff --git a/server/container_stop.go b/server/container_stop.go index cff22363..9a528f61 100644 --- a/server/container_stop.go +++ b/server/container_stop.go @@ -17,9 +17,6 @@ func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest return nil, err } - if err := s.Runtime().UpdateStatus(c); err != nil { - return nil, err - } cStatus := s.Runtime().ContainerStatus(c) if cStatus.Status != oci.ContainerStateStopped { if err := s.Runtime().StopContainer(c, req.Timeout); err != nil {