server: move StopAllSandboxes in sandbox_stop.go
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
3b2e5aa5c2
commit
de96e54230
2 changed files with 13 additions and 13 deletions
|
@ -106,16 +106,3 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR
|
||||||
logrus.Debugf("RemovePodSandboxResponse %+v", resp)
|
logrus.Debugf("RemovePodSandboxResponse %+v", resp)
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopAllPodSandboxes removes all pod sandboxes
|
|
||||||
func (s *Server) StopAllPodSandboxes() {
|
|
||||||
logrus.Debugf("StopAllPodSandboxes")
|
|
||||||
for _, sb := range s.state.sandboxes {
|
|
||||||
pod := &pb.StopPodSandboxRequest{
|
|
||||||
PodSandboxId: sb.id,
|
|
||||||
}
|
|
||||||
if _, err := s.StopPodSandbox(nil, pod); err != nil {
|
|
||||||
logrus.Warnf("could not StopPodSandbox %s: %v", sb.id, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -59,3 +59,16 @@ func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxReque
|
||||||
logrus.Debugf("StopPodSandboxResponse: %+v", resp)
|
logrus.Debugf("StopPodSandboxResponse: %+v", resp)
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StopAllPodSandboxes removes all pod sandboxes
|
||||||
|
func (s *Server) StopAllPodSandboxes() {
|
||||||
|
logrus.Debugf("StopAllPodSandboxes")
|
||||||
|
for _, sb := range s.state.sandboxes {
|
||||||
|
pod := &pb.StopPodSandboxRequest{
|
||||||
|
PodSandboxId: sb.id,
|
||||||
|
}
|
||||||
|
if _, err := s.StopPodSandbox(nil, pod); err != nil {
|
||||||
|
logrus.Warnf("could not StopPodSandbox %s: %v", sb.id, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue