fix(imagepin): 带 digest 的镜像引用也向 registry 确认仍存在

This commit is contained in:
Lemon-miaow committed 2026-09-24 22:58:07 +08:00
1 parent 7f772bccbb
commit 05e8c64e47
3 files changed
+49 -8

No files matched your search

+3
View File
@@ -270,6 +270,9 @@ func (a *API) pinImage(ctx context.Context, ref string) (string, error) {
}
pinned, err := a.Images.Pin(ctx, ref)
switch {
case errors.Is(err, imagepin.ErrNotFound) && imagepin.Pinned(ref):
return "", newError(http.StatusBadRequest, "image_not_in_registry",
"the registry no longer holds build %q (nothing referenced it, so it was pruned); pick a current tag", ref)
case errors.Is(err, imagepin.ErrNotFound):
return "", newError(http.StatusBadRequest, "image_not_in_registry",
"image %q is whitelisted but the registry does not hold it; build or push it first", ref)