Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
shimv2: check correct error variable for deferred func in service#Sta…
Browse files Browse the repository at this point in the history
…rtShim

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 <[email protected]>
(cherry picked from commit 20fe3bb)
  • Loading branch information
tedyu authored and fidencio committed Jun 24, 2020
1 parent 1f9b733 commit ad53710
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad53710

Please sign in to comment.