99 "path"
1010 "path/filepath"
1111 "reflect"
12- "strings"
1312 "time"
1413
1514 apitypes "github.com/alibaba/pouch/apis/types"
@@ -649,7 +648,7 @@ func (c *CriManager) ContainerStatus(ctx context.Context, r *runtime.ContainerSt
649648 labels , annotations := extractLabels (container .Config .Labels )
650649
651650 imageRef := container .Image
652- imageInfo , err := c .ImageMgr .GetImage (ctx , strings . TrimPrefix ( imageRef , "sha256:" ) )
651+ imageInfo , err := c .ImageMgr .GetImage (ctx , imageRef )
653652 if err != nil {
654653 return nil , fmt .Errorf ("failed to get image %s: %v" , imageRef , err )
655654 }
@@ -826,7 +825,7 @@ func (c *CriManager) ListImages(ctx context.Context, r *runtime.ListImagesReques
826825 continue
827826 }
828827 // NOTE: we should query image cache to get the correct image info.
829- imageInfo , err := c .ImageMgr .GetImage (ctx , strings . TrimPrefix ( i .ID , "sha256:" ) )
828+ imageInfo , err := c .ImageMgr .GetImage (ctx , i .ID )
830829 if err != nil {
831830 continue
832831 }
@@ -850,7 +849,7 @@ func (c *CriManager) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ
850849 return nil , err
851850 }
852851
853- imageInfo , err := c .ImageMgr .GetImage (ctx , strings . TrimPrefix ( ref .String (), "sha256:" ))
852+ imageInfo , err := c .ImageMgr .GetImage (ctx , ref .String ())
854853 if err != nil {
855854 // TODO: separate ErrImageNotFound with others.
856855 // Now we just return empty if the error occurred.
@@ -894,7 +893,7 @@ func (c *CriManager) PullImage(ctx context.Context, r *runtime.PullImageRequest)
894893
895894// RemoveImage removes the image.
896895func (c * CriManager ) RemoveImage (ctx context.Context , r * runtime.RemoveImageRequest ) (* runtime.RemoveImageResponse , error ) {
897- imageRef := strings . TrimPrefix ( r .GetImage ().GetImage (), "sha256:" )
896+ imageRef := r .GetImage ().GetImage ()
898897
899898 if err := c .ImageMgr .RemoveImage (ctx , imageRef , false ); err != nil {
900899 if errtypes .IsNotfound (err ) {
0 commit comments