weldr: Setup NewTestAPI correctly

The host distro needs to be passed to New in the first position, AND
second so that it ends up in the distro map. Without this
distros.GetDistro() will fail because it cannot lookup the host distro
name.
This commit is contained in:
Brian C. Lane 2021-05-19 13:59:03 -07:00 committed by Ondřej Budai
parent 3caa6ba24d
commit d63dd09686

View file

@ -100,7 +100,7 @@ var ValidBlueprintName = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`)
// NewTestAPI is used for the test framework, sets up a single distro
func NewTestAPI(rpm rpmmd.RPMMD, arch distro.Arch, distro distro.Distro, rr *reporegistry.RepoRegistry, logger *log.Logger, store *store.Store, workers *worker.Server, compatOutputDir string) *API {
distros, _ := distroregistry.New(distro)
distros, _ := distroregistry.New(distro, distro)
api := &API{
store: store,