commit
3cb3445cb0
10 changed files with 1 additions and 12 deletions
|
@ -210,7 +210,6 @@ func ensureSaneLogPath(logPath string) error {
|
||||||
// CreateContainer creates a new container in specified PodSandbox
|
// CreateContainer creates a new container in specified PodSandbox
|
||||||
func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error) {
|
func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error) {
|
||||||
logrus.Debugf("CreateContainerRequest %+v", req)
|
logrus.Debugf("CreateContainerRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
|
|
||||||
s.updateLock.RLock()
|
s.updateLock.RLock()
|
||||||
defer s.updateLock.RUnlock()
|
defer s.updateLock.RUnlock()
|
||||||
|
|
|
@ -29,7 +29,6 @@ func filterContainer(c *pb.Container, filter *pb.ContainerFilter) bool {
|
||||||
// ListContainers lists all containers by filters.
|
// ListContainers lists all containers by filters.
|
||||||
func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersRequest) (*pb.ListContainersResponse, error) {
|
func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersRequest) (*pb.ListContainersResponse, error) {
|
||||||
logrus.Debugf("ListContainersRequest %+v", req)
|
logrus.Debugf("ListContainersRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
var ctrs []*pb.Container
|
var ctrs []*pb.Container
|
||||||
filter := req.Filter
|
filter := req.Filter
|
||||||
ctrList := s.state.containers.List()
|
ctrList := s.state.containers.List()
|
||||||
|
|
|
@ -13,7 +13,6 @@ import (
|
||||||
// should be force removed.
|
// should be force removed.
|
||||||
func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerRequest) (*pb.RemoveContainerResponse, error) {
|
func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerRequest) (*pb.RemoveContainerResponse, error) {
|
||||||
logrus.Debugf("RemoveContainerRequest %+v", req)
|
logrus.Debugf("RemoveContainerRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
c, err := s.getContainerFromRequest(req.ContainerId)
|
c, err := s.getContainerFromRequest(req.ContainerId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
// StartContainer starts the container.
|
// StartContainer starts the container.
|
||||||
func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerRequest) (*pb.StartContainerResponse, error) {
|
func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerRequest) (*pb.StartContainerResponse, error) {
|
||||||
logrus.Debugf("StartContainerRequest %+v", req)
|
logrus.Debugf("StartContainerRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
c, err := s.getContainerFromRequest(req.ContainerId)
|
c, err := s.getContainerFromRequest(req.ContainerId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -13,7 +13,6 @@ import (
|
||||||
// ContainerStatus returns status of the container.
|
// ContainerStatus returns status of the container.
|
||||||
func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusRequest) (*pb.ContainerStatusResponse, error) {
|
func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusRequest) (*pb.ContainerStatusResponse, error) {
|
||||||
logrus.Debugf("ContainerStatusRequest %+v", req)
|
logrus.Debugf("ContainerStatusRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
c, err := s.getContainerFromRequest(req.ContainerId)
|
c, err := s.getContainerFromRequest(req.ContainerId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
// StopContainer stops a running container with a grace period (i.e., timeout).
|
// 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) {
|
func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest) (*pb.StopContainerResponse, error) {
|
||||||
logrus.Debugf("StopContainerRequest %+v", req)
|
logrus.Debugf("StopContainerRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
c, err := s.getContainerFromRequest(req.ContainerId)
|
c, err := s.getContainerFromRequest(req.ContainerId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -29,7 +29,6 @@ func filterSandbox(p *pb.PodSandbox, filter *pb.PodSandboxFilter) bool {
|
||||||
// ListPodSandbox returns a list of SandBoxes.
|
// ListPodSandbox returns a list of SandBoxes.
|
||||||
func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxRequest) (*pb.ListPodSandboxResponse, error) {
|
func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxRequest) (*pb.ListPodSandboxResponse, error) {
|
||||||
logrus.Debugf("ListPodSandboxRequest %+v", req)
|
logrus.Debugf("ListPodSandboxRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
var pods []*pb.PodSandbox
|
var pods []*pb.PodSandbox
|
||||||
var podList []*sandbox
|
var podList []*sandbox
|
||||||
for _, sb := range s.state.sandboxes {
|
for _, sb := range s.state.sandboxes {
|
||||||
|
|
|
@ -15,7 +15,6 @@ import (
|
||||||
// sandbox, they should be force deleted.
|
// sandbox, they should be force deleted.
|
||||||
func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxRequest) (*pb.RemovePodSandboxResponse, error) {
|
func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxRequest) (*pb.RemovePodSandboxResponse, error) {
|
||||||
logrus.Debugf("RemovePodSandboxRequest %+v", req)
|
logrus.Debugf("RemovePodSandboxRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == errSandboxIDEmpty {
|
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)
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +82,6 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR
|
||||||
}
|
}
|
||||||
|
|
||||||
s.removeContainer(podInfraContainer)
|
s.removeContainer(podInfraContainer)
|
||||||
sb.infraContainer = nil
|
|
||||||
|
|
||||||
// Remove the files related to the sandbox
|
// Remove the files related to the sandbox
|
||||||
if err := s.storageRuntimeServer.StopContainer(sb.id); err != nil {
|
if err := s.storageRuntimeServer.StopContainer(sb.id); err != nil {
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
// PodSandboxStatus returns the Status of the PodSandbox.
|
// PodSandboxStatus returns the Status of the PodSandbox.
|
||||||
func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusRequest) (*pb.PodSandboxStatusResponse, error) {
|
func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusRequest) (*pb.PodSandboxStatusResponse, error) {
|
||||||
logrus.Debugf("PodSandboxStatusRequest %+v", req)
|
logrus.Debugf("PodSandboxStatusRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -14,7 +14,6 @@ import (
|
||||||
// sandbox, they should be force terminated.
|
// sandbox, they should be force terminated.
|
||||||
func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxRequest) (*pb.StopPodSandboxResponse, error) {
|
func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxRequest) (*pb.StopPodSandboxResponse, error) {
|
||||||
logrus.Debugf("StopPodSandboxRequest %+v", req)
|
logrus.Debugf("StopPodSandboxRequest %+v", req)
|
||||||
s.Update()
|
|
||||||
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
sb, err := s.getPodSandboxFromRequest(req.PodSandboxId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue