osbuild-pipeline: use repo name from the request if provided
Almost all repo configurations used for generating image test cases using `osbuild-pipeline` have `name` defined. Make sure that the repo name provided in the compose request is used when depsolving. Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
parent
13a9022fd8
commit
562225af4c
1 changed files with 6 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import (
|
|||
)
|
||||
|
||||
type repository struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
BaseURL string `json:"baseurl,omitempty"`
|
||||
Metalink string `json:"metalink,omitempty"`
|
||||
MirrorList string `json:"mirrorlist,omitempty"`
|
||||
|
|
@ -102,8 +103,12 @@ func main() {
|
|||
|
||||
repos := make([]rpmmd.RepoConfig, len(composeRequest.Repositories))
|
||||
for i, repo := range composeRequest.Repositories {
|
||||
repoName := repo.Name
|
||||
if repoName == "" {
|
||||
repoName = fmt.Sprintf("repo-%d", i)
|
||||
}
|
||||
repos[i] = rpmmd.RepoConfig{
|
||||
Name: fmt.Sprintf("repo-%d", i),
|
||||
Name: repoName,
|
||||
BaseURL: repo.BaseURL,
|
||||
Metalink: repo.Metalink,
|
||||
MirrorList: repo.MirrorList,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue