From 4d5ea12c3b35530144a0bb5441f1f3de89f5bc2b Mon Sep 17 00:00:00 2001 From: mudler-agent Date: Sat, 19 Sep 2026 13:50:43 +0200 Subject: [PATCH] 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 Co-authored-by: Ettore Di Giacinto --- core/gallery/upgrade.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/gallery/upgrade.go b/core/gallery/upgrade.go index 7abc65a43..4af56e256 100644 --- a/core/gallery/upgrade.go +++ b/core/gallery/upgrade.go @@ -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