pod/container name should be released when create failed
Signed-off-by: Crazykev <crazykev@zju.edu.cn>
This commit is contained in:
parent
96cc03ccd9
commit
f6536bf30e
3 changed files with 8 additions and 6 deletions
|
@ -93,6 +93,7 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
|
|||
containerDir := filepath.Join(s.runtime.ContainerDir(), containerID)
|
||||
defer func() {
|
||||
if err != nil {
|
||||
s.releaseContainerName(containerName)
|
||||
err1 := os.RemoveAll(containerDir)
|
||||
if err1 != nil {
|
||||
logrus.Warnf("Failed to cleanup container directory: %v")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue