diff --git a/server/container_create.go b/server/container_create.go index 3136268a..a25c8c83 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -210,7 +210,6 @@ func ensureSaneLogPath(logPath string) error { // CreateContainer creates a new container in specified PodSandbox func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error) { logrus.Debugf("CreateContainerRequest %+v", req) - s.Update() s.updateLock.RLock() defer s.updateLock.RUnlock() diff --git a/server/container_list.go b/server/container_list.go index ce6171db..9e372a5f 100644 --- a/server/container_list.go +++ b/server/container_list.go @@ -29,7 +29,6 @@ func filterContainer(c *pb.Container, filter *pb.ContainerFilter) bool { // ListContainers lists all containers by filters. func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersRequest) (*pb.ListContainersResponse, error) { logrus.Debugf("ListContainersRequest %+v", req) - s.Update() var ctrs []*pb.Container filter := req.Filter ctrList := s.state.containers.List() diff --git a/server/container_remove.go b/server/container_remove.go index d4d33cc5..028ffed8 100644 --- a/server/container_remove.go +++ b/server/container_remove.go @@ -13,7 +13,6 @@ import ( // should be force removed. func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerRequest) (*pb.RemoveContainerResponse, error) { logrus.Debugf("RemoveContainerRequest %+v", req) - s.Update() c, err := s.getContainerFromRequest(req.ContainerId) if err != nil { return nil, err diff --git a/server/container_start.go b/server/container_start.go index 13b6bfe2..128cc5fc 100644 --- a/server/container_start.go +++ b/server/container_start.go @@ -11,7 +11,6 @@ import ( // StartContainer starts the container. func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerRequest) (*pb.StartContainerResponse, error) { logrus.Debugf("StartContainerRequest %+v", req) - s.Update() c, err := s.getContainerFromRequest(req.ContainerId) if err != nil { return nil, err diff --git a/server/container_status.go b/server/container_status.go index 096b70c6..82a51877 100644 --- a/server/container_status.go +++ b/server/container_status.go @@ -13,7 +13,6 @@ import ( // ContainerStatus returns status of the container. func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusRequest) (*pb.ContainerStatusResponse, error) { logrus.Debugf("ContainerStatusRequest %+v", req) - s.Update() c, err := s.getContainerFromRequest(req.ContainerId) if err != nil { return nil, err diff --git a/server/container_stop.go b/server/container_stop.go index aed5a56c..58865edf 100644 --- a/server/container_stop.go +++ b/server/container_stop.go @@ -12,7 +12,6 @@ import ( // StopContainer stops a running container with a grace period (i.e., timeout). func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest) (*pb.StopContainerResponse, error) { logrus.Debugf("StopContainerRequest %+v", req) - s.Update() c, err := s.getContainerFromRequest(req.ContainerId) if err != nil { return nil, err diff --git a/server/sandbox_list.go b/server/sandbox_list.go index b45220cb..9e4b3562 100644 --- a/server/sandbox_list.go +++ b/server/sandbox_list.go @@ -29,7 +29,6 @@ func filterSandbox(p *pb.PodSandbox, filter *pb.PodSandboxFilter) bool { // ListPodSandbox returns a list of SandBoxes. func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxRequest) (*pb.ListPodSandboxResponse, error) { logrus.Debugf("ListPodSandboxRequest %+v", req) - s.Update() var pods []*pb.PodSandbox var podList []*sandbox for _, sb := range s.state.sandboxes { diff --git a/server/sandbox_remove.go b/server/sandbox_remove.go index c647d948..9628c6b5 100644 --- a/server/sandbox_remove.go +++ b/server/sandbox_remove.go @@ -15,7 +15,6 @@ import ( // sandbox, they should be force deleted. func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxRequest) (*pb.RemovePodSandboxResponse, error) { logrus.Debugf("RemovePodSandboxRequest %+v", req) - s.Update() sb, err := s.getPodSandboxFromRequest(req.PodSandboxId) if err != nil { if err == errSandboxIDEmpty { @@ -49,7 +48,7 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR return nil, fmt.Errorf("failed to delete container %s in pod sandbox %s: %v", c.Name(), sb.id, err) } - if c == podInfraContainer { + if c.ID() == podInfraContainer.ID() { continue } @@ -83,7 +82,6 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR } s.removeContainer(podInfraContainer) - sb.infraContainer = nil // Remove the files related to the sandbox if err := s.storageRuntimeServer.StopContainer(sb.id); err != nil { diff --git a/server/sandbox_status.go b/server/sandbox_status.go index ea16802d..7f8b241f 100644 --- a/server/sandbox_status.go +++ b/server/sandbox_status.go @@ -10,7 +10,6 @@ import ( // PodSandboxStatus returns the Status of the PodSandbox. func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusRequest) (*pb.PodSandboxStatusResponse, error) { logrus.Debugf("PodSandboxStatusRequest %+v", req) - s.Update() sb, err := s.getPodSandboxFromRequest(req.PodSandboxId) if err != nil { return nil, err diff --git a/server/sandbox_stop.go b/server/sandbox_stop.go index e8dd61c6..002dbb24 100644 --- a/server/sandbox_stop.go +++ b/server/sandbox_stop.go @@ -14,7 +14,6 @@ import ( // sandbox, they should be force terminated. func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxRequest) (*pb.StopPodSandboxResponse, error) { logrus.Debugf("StopPodSandboxRequest %+v", req) - s.Update() sb, err := s.getPodSandboxFromRequest(req.PodSandboxId) if err != nil { return nil, err