Skip to content

Commit c6f4083

Browse files
mvo5achilleas-k
authored andcommitted
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.
1 parent ee12379 commit c6f4083

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/cloudapi/v2/depsolve.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ func (request *DepsolveRequest) Depsolve(df *distrofactory.Factory, rr *reporegi
6767
if err != nil {
6868
return nil, HTTPError(ErrorUnsupportedImageType)
6969
}
70-
70+
// image type may have "tagged" repos that are only available for this
71+
// image type so we need to re-read
72+
repos, err = rr.ReposByImageTypeName(imageType.Arch().Distro().Name(), imageType.Arch().Name(), imageType.Name())
73+
if err != nil {
74+
return nil, HTTPError(ErrorUnsupportedImageType)
75+
}
7176
// use the same seed for all images so we get the same IDs
7277
bigSeed, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))
7378
if err != nil {

0 commit comments

Comments
 (0)