9
9
"path"
10
10
"path/filepath"
11
11
"reflect"
12
- "strings"
13
12
"time"
14
13
15
14
apitypes "github.com/alibaba/pouch/apis/types"
@@ -649,7 +648,7 @@ func (c *CriManager) ContainerStatus(ctx context.Context, r *runtime.ContainerSt
649
648
labels , annotations := extractLabels (container .Config .Labels )
650
649
651
650
imageRef := container .Image
652
- imageInfo , err := c .ImageMgr .GetImage (ctx , strings . TrimPrefix ( imageRef , "sha256:" ) )
651
+ imageInfo , err := c .ImageMgr .GetImage (ctx , imageRef )
653
652
if err != nil {
654
653
return nil , fmt .Errorf ("failed to get image %s: %v" , imageRef , err )
655
654
}
@@ -826,7 +825,7 @@ func (c *CriManager) ListImages(ctx context.Context, r *runtime.ListImagesReques
826
825
continue
827
826
}
828
827
// 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 )
830
829
if err != nil {
831
830
continue
832
831
}
@@ -850,7 +849,7 @@ func (c *CriManager) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequ
850
849
return nil , err
851
850
}
852
851
853
- imageInfo , err := c .ImageMgr .GetImage (ctx , strings . TrimPrefix ( ref .String (), "sha256:" ))
852
+ imageInfo , err := c .ImageMgr .GetImage (ctx , ref .String ())
854
853
if err != nil {
855
854
// TODO: separate ErrImageNotFound with others.
856
855
// Now we just return empty if the error occurred.
@@ -894,7 +893,7 @@ func (c *CriManager) PullImage(ctx context.Context, r *runtime.PullImageRequest)
894
893
895
894
// RemoveImage removes the image.
896
895
func (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 ()
898
897
899
898
if err := c .ImageMgr .RemoveImage (ctx , imageRef , false ); err != nil {
900
899
if errtypes .IsNotfound (err ) {
0 commit comments