sandbox_run: correct a defer
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
e28540ca90
commit
cfec2c4cf4
1 changed files with 1 additions and 1 deletions
|
@ -317,13 +317,13 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.addSandbox(sb)
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.removeSandbox(id)
|
s.removeSandbox(id)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
s.addSandbox(sb)
|
|
||||||
if err = s.podIDIndex.Add(id); err != nil {
|
if err = s.podIDIndex.Add(id); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue