fix(gallery): strip oci:// before upgrade-check digest lookup (#12138)

GetImageDigest calls name.ParseReference, which cannot parse the oci://
scheme. Self-hosted registries must set the scheme to be recognised by
LooksLikeOCI, so without stripping it they silently lose upgrade detection.

Strips the prefix at the call site, matching what the other two call
sites already do (pkg/downloader/uri.go, gallery/importers/llama-cpp.go).

Supersedes #12120 (DCO not signed by contributor, branch had unrelated
history needing rebase).

Assisted-by: MAKI:regolo/glm5.2

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
mudler-agentandEttore Di Giacinto authored and GitHub committed 2026-09-19 13:50:43 +02:00
1 parent 8b01583e70
commit 4d5ea12c3b
1 file changed
+6 -1
+6 -1
View File
@@ -170,7 +170,12 @@ func CheckUpgradesAgainst(ctx context.Context, galleries []config.Gallery, syste
// Fall back to OCI digest comparison when versions are unavailable.
if downloader.URI(galleryEntry.URI).LooksLikeOCI() {
remoteDigest, err := oci.GetImageDigest(galleryEntry.URI, "", nil, nil)
// Strip the oci:// scheme — name.ParseReference (called by
// GetImageDigest) cannot parse it. Self-hosted registries must
// set the scheme to be recognised at all, so without stripping
// they silently lose upgrade detection.
remoteDigest, err := oci.GetImageDigest(
strings.TrimPrefix(galleryEntry.URI, downloader.OCIPrefix), "", nil, nil)
if err != nil {
xlog.Warn("Failed to get remote OCI digest for upgrade check", "backend", installed.Metadata.Name, "error", err)
continue