From 3c08ebac14437c3d58e3bb507d71c750453ab787 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 30 Oct 2025 11:54:22 +0100 Subject: [PATCH 1/2] weldr: use ReposByArchName() instead of DistroHasRepos() By doing this we can drop the DistroHasRepos() from images. This is the only API user. If dropping is undesired I think we should change the signature of DistroHasRepos() to become `(bool, error)` (or just error). --- internal/weldr/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/weldr/api.go b/internal/weldr/api.go index c10f43075f..9ad3cdd470 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -133,7 +133,7 @@ func (api *API) validDistros(arch string) []string { continue } - _, err := api.repoRegistry.DistroHasRepos(distroName, arch) + _, err := api.repoRegistry.ReposByArchName(distroName, arch, false) if err == nil { distros = append(distros, distroName) } else { From cb529a4537536cc2b90b48facf318e4f3ce1c73b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 30 Oct 2025 12:02:13 +0100 Subject: [PATCH 2/2] cloudapi: when depsolving specific imagetypes used ReposByImageTypeName The cloudapi depsolve() endpoint is currently not taking tagged repositories into account. Ensure that when an imagetype is specified the repos are parsed again so that any "tagged" repos for specific image types are taken into account as well. --- internal/cloudapi/v2/depsolve.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/cloudapi/v2/depsolve.go b/internal/cloudapi/v2/depsolve.go index d253b7c23f..301b154113 100644 --- a/internal/cloudapi/v2/depsolve.go +++ b/internal/cloudapi/v2/depsolve.go @@ -67,7 +67,12 @@ func (request *DepsolveRequest) Depsolve(df *distrofactory.Factory, rr *reporegi if err != nil { return nil, HTTPError(ErrorUnsupportedImageType) } - + // image type may have "tagged" repos that are only available for this + // image type so we need to re-read + repos, err = rr.ReposByImageTypeName(imageType.Arch().Distro().Name(), imageType.Arch().Name(), imageType.Name()) + if err != nil { + return nil, HTTPError(ErrorUnsupportedImageType) + } // use the same seed for all images so we get the same IDs bigSeed, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) if err != nil {