distro: panic if chained package set is not specified
If an image type defines a package set name as part of a chain and that package set is not defined, this is a programming error so we should panic().
This commit is contained in:
parent
d470a3cb3f
commit
ce1474e364
1 changed files with 6 additions and 2 deletions
|
|
@ -307,8 +307,12 @@ func MakePackageSetChains(t ImageType, packageSets map[string]rpmmd.PackageSet,
|
|||
|
||||
// add package-set-specific repositories to each set if one is defined
|
||||
for idx, pkgSetName := range setNames {
|
||||
pkgSets[idx] = packageSets[pkgSetName]
|
||||
pkgSets[idx].Repositories = packageSetsRepos[pkgSetName]
|
||||
pkgSet, ok := packageSets[pkgSetName]
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("image type %q specifies chained package set %q but no package set with that name exists", t.Name(), pkgSetName))
|
||||
}
|
||||
pkgSet.Repositories = packageSetsRepos[pkgSetName]
|
||||
pkgSets[idx] = pkgSet
|
||||
addedSets[pkgSetName] = true
|
||||
}
|
||||
chainedSets[specName] = pkgSets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue