Skip to content

Commit

Permalink
containerd: Add error handling in getImageConfig for GetImageHash.
Browse files Browse the repository at this point in the history
Added proper error logging and return when `GetImageHash` fails in the
`getImageConfig` function. This ensures that the error is not silently ignored
and provides clearer debugging information.

Signed-off-by: Nikolay Martyanov <[email protected]>
  • Loading branch information
OhmSpectator authored and eriknordmark committed Oct 24, 2023
1 parent 5616c5c commit 85ab36b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/pillar/cas/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,8 @@ func getImageConfig(c *containerdCAS, reference string) (*ocispec.Image, error)
imageParentHash, err := c.GetImageHash(reference)
if err != nil {
err = fmt.Errorf("getImageConfig: exception while fetching reference hash of %s: %s", reference, err.Error())

logrus.Errorf(err.Error())
return nil, err
}

ctrdCtx, done := c.ctrdClient.CtrNewUserServicesCtx()
Expand Down

0 comments on commit 85ab36b

Please sign in to comment.