sandbox_stop: Store stopped status
This allows us to respond to kubelet quickly if the pod was already stopped successfully earlier. Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
ce17c5214d
commit
8d58f227cd
2 changed files with 19 additions and 0 deletions
|
@ -37,6 +37,10 @@ func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxReque
|
|||
return resp, nil
|
||||
}
|
||||
|
||||
if sb.Stopped() {
|
||||
return &pb.StopPodSandboxResponse{}, nil
|
||||
}
|
||||
|
||||
podInfraContainer := sb.InfraContainer()
|
||||
netnsPath, err := podInfraContainer.NetNsPath()
|
||||
if err != nil {
|
||||
|
@ -110,6 +114,7 @@ func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxReque
|
|||
logrus.Warnf("failed to stop sandbox container in pod sandbox %s: %v", sb.ID(), err)
|
||||
}
|
||||
|
||||
sb.SetStopped()
|
||||
resp := &pb.StopPodSandboxResponse{}
|
||||
logrus.Debugf("StopPodSandboxResponse: %+v", resp)
|
||||
return resp, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue