Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,14 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
if err := s.createContainerPlatform(newContainer, sb.CgroupParent()); err != nil {
return nil, err
}
defer func() {
if retErr != nil {
log.Infof(ctx, "createCtr: removing container ID %s from runtime", ctr.ID())
if err2 := s.Runtime().DeleteContainer(newContainer); err2 != nil {
log.Warnf(ctx, "failed to delete container in runtime %s: %v", ctr.ID(), err)
}
}
}()

if err := s.ContainerStateToDisk(newContainer); err != nil {
log.Warnf(ctx, "unable to write containers %s state to disk: %v", newContainer.ID(), err)
Expand Down