Skip to content

Commit 7c413ab

Browse files
committed
fix batch and single
1 parent a7d009a commit 7c413ab

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backend/internal/services/image_update_service.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ func (s *ImageUpdateService) checkSingleImageInBatch(
811811
}
812812
}
813813

814-
localDigest, ldErr := s.getLocalImageDigest(ctx, fmt.Sprintf("%s/%s:%s", parts.Registry, parts.Repository, parts.Tag))
814+
localDigest, allLocalDigests, ldErr := s.getLocalImageDigestWithAll(ctx, fmt.Sprintf("%s/%s:%s", parts.Registry, parts.Repository, parts.Tag))
815815
if ldErr != nil {
816816
return &dto.ImageUpdateResponse{
817817
Error: ldErr.Error(),
@@ -824,7 +824,13 @@ func (s *ImageUpdateService) checkSingleImageInBatch(
824824
}
825825
}
826826

827-
hasDigestUpdate := localDigest != remoteDigest
827+
hasDigestUpdate := true
828+
for _, localDig := range allLocalDigests {
829+
if localDig == remoteDigest {
830+
hasDigestUpdate = false
831+
break
832+
}
833+
}
828834

829835
return &dto.ImageUpdateResponse{
830836
HasUpdate: hasDigestUpdate,

0 commit comments

Comments
 (0)