Skip to content

Commit 6384aa4

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 7c1612a commit 6384aa4

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
@@ -914,7 +914,8 @@ func getImageConfig(c *containerdCAS, reference string) (*ocispec.Image, error)
914914
imageParentHash, err := c.GetImageHash(reference)
915915
if err != nil {
916916
err = fmt.Errorf("getImageConfig: exception while fetching reference hash of %s: %s", reference, err.Error())
917-
917+
logrus.Errorf(err.Error())
918+
return nil, err
918919
}
919920

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

0 commit comments

Comments
 (0)