Merge a8e7e22a79
into cb7239caa6
This commit is contained in:
commit
3917598a4c
1 changed files with 10 additions and 0 deletions
|
@ -383,6 +383,16 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sb := s.getSandbox(c.Sandbox())
|
||||||
|
if sb == nil {
|
||||||
|
return nil, fmt.Errorf("failed to find sandbox for container %s", c.ID())
|
||||||
|
}
|
||||||
|
|
||||||
|
podInfraContainerName := sb.name + "-infra"
|
||||||
|
if podInfraContainerName == c.Name() {
|
||||||
|
return nil, fmt.Errorf("can not delete Infra container %s\n", c.ID())
|
||||||
|
}
|
||||||
|
|
||||||
if err := s.runtime.UpdateStatus(c); err != nil {
|
if err := s.runtime.UpdateStatus(c); err != nil {
|
||||||
return nil, fmt.Errorf("failed to update container state: %v", err)
|
return nil, fmt.Errorf("failed to update container state: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue