mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	runtime: sandbox delete should succeed after verifying sandbox state
Otherwise we might block delete and create orphan containers. Fixes: #1039 Signed-off-by: Peng Tao <bergwolf@hyper.sh> Signed-off-by: Eric Ernst <eric_ernst@apple.com>
This commit is contained in:
		| @@ -686,13 +686,13 @@ func (s *Sandbox) Delete(ctx context.Context) error { | ||||
|  | ||||
| 	for _, c := range s.containers { | ||||
| 		if err := c.delete(ctx); err != nil { | ||||
| 			return err | ||||
| 			s.Logger().WithError(err).WithField("cid", c.id).Debug("failed to delete container") | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if !rootless.IsRootless() { | ||||
| 		if err := s.cgroupsDelete(); err != nil { | ||||
| 			return err | ||||
| 			s.Logger().WithError(err).Error("failed to cleanup cgroups") | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user