Skip to content

Commit 7ffef97

Browse files
OhmSpectatoreriknordmark
authored andcommitted
containerd: Add error handling in getImageConfig for GetImageHash.
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]>
1 parent ead88bf commit 7ffef97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/pillar/cas/containerd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,8 @@ func getImageConfig(c *containerdCAS, reference string) (*ocispec.Image, error)
913913
imageParentHash, err := c.GetImageHash(reference)
914914
if err != nil {
915915
err = fmt.Errorf("getImageConfig: exception while fetching reference hash of %s: %s", reference, err.Error())
916-
916+
logrus.Errorf(err.Error())
917+
return nil, err
917918
}
918919

919920
ctrdCtx, done := c.ctrdClient.CtrNewUserServicesCtx()

0 commit comments

Comments
 (0)