mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-15 13:58:55 +00:00
shimv2: check correct error variable for deferred func in service#StartShim
In service#StartShim, there is no applicable error variable which is checked by deferred func because the err variable is redefined. This PR fixes the error variable. Fixes #2727 Signed-off-by: Ted Yu <yuzhihong@gmail.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
@@ -211,10 +211,10 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container
|
||||
|
||||
// make sure to wait after start
|
||||
go cmd.Wait()
|
||||
if err := cdshim.WritePidFile("shim.pid", cmd.Process.Pid); err != nil {
|
||||
if err = cdshim.WritePidFile("shim.pid", cmd.Process.Pid); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := cdshim.WriteAddress("address", address); err != nil {
|
||||
if err = cdshim.WriteAddress("address", address); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return address, nil
|
||||
|
Reference in New Issue
Block a user