internal/rpmmd: add missing fields to RepoConfig
Further align the RepoConfig object to the dnf spec and add missing fields.
This commit is contained in:
parent
d44703cdc8
commit
3b6fddb14a
4 changed files with 41 additions and 15 deletions
|
|
@ -17,7 +17,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/container"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/distroregistry"
|
||||
|
|
@ -39,11 +38,14 @@ func (mv *multiValue) Set(v string) error {
|
|||
|
||||
type repository struct {
|
||||
Name string `json:"name"`
|
||||
Id string `json:"id,omitempty"`
|
||||
BaseURL string `json:"baseurl,omitempty"`
|
||||
Metalink string `json:"metalink,omitempty"`
|
||||
MirrorList string `json:"mirrorlist,omitempty"`
|
||||
GPGKey string `json:"gpgkey,omitempty"`
|
||||
CheckGPG bool `json:"check_gpg,omitempty"`
|
||||
CheckRepoGPG bool `json:"check_repo_gpg,omitempty"`
|
||||
IgnoreSSL bool `json:"ignore_ssl,omitempty"`
|
||||
RHSM bool `json:"rhsm,omitempty"`
|
||||
MetadataExpire string `json:"metadata_expire,omitempty"`
|
||||
ImageTypeTags []string `json:"image_type_tags,omitempty"`
|
||||
|
|
@ -199,14 +201,15 @@ func convertRepo(r repository) rpmmd.RepoConfig {
|
|||
}
|
||||
|
||||
return rpmmd.RepoConfig{
|
||||
Id: r.Id,
|
||||
Name: r.Name,
|
||||
BaseURLs: urls,
|
||||
Metalink: r.Metalink,
|
||||
MirrorList: r.MirrorList,
|
||||
GPGKeys: keys,
|
||||
CheckGPG: &r.CheckGPG,
|
||||
CheckRepoGPG: common.ToPtr(false),
|
||||
IgnoreSSL: false,
|
||||
CheckRepoGPG: &r.CheckRepoGPG,
|
||||
IgnoreSSL: r.IgnoreSSL,
|
||||
MetadataExpire: r.MetadataExpire,
|
||||
RHSM: r.RHSM,
|
||||
ImageTypeTags: r.ImageTypeTags,
|
||||
|
|
|
|||
|
|
@ -19,14 +19,17 @@ import (
|
|||
)
|
||||
|
||||
type repository struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
BaseURL string `json:"baseurl,omitempty"`
|
||||
Metalink string `json:"metalink,omitempty"`
|
||||
MirrorList string `json:"mirrorlist,omitempty"`
|
||||
GPGKey string `json:"gpgkey,omitempty"`
|
||||
CheckGPG bool `json:"check_gpg,omitempty"`
|
||||
PackageSets []string `json:"package_sets,omitempty"`
|
||||
RHSM bool `json:"rhsm,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
BaseURL string `json:"baseurl,omitempty"`
|
||||
Metalink string `json:"metalink,omitempty"`
|
||||
MirrorList string `json:"mirrorlist,omitempty"`
|
||||
GPGKey string `json:"gpgkey,omitempty"`
|
||||
CheckGPG bool `json:"check_gpg,omitempty"`
|
||||
CheckRepoGPG bool `json:"repo_check_gpg,omitempty"`
|
||||
IgnoreSSL bool `json:"ignore_ssl,omitempty"`
|
||||
PackageSets []string `json:"package_sets,omitempty"`
|
||||
RHSM bool `json:"rhsm,omitempty"`
|
||||
}
|
||||
|
||||
type ostreeOptions struct {
|
||||
|
|
@ -141,6 +144,10 @@ func main() {
|
|||
if repoName == "" {
|
||||
repoName = fmt.Sprintf("repo-%d", i)
|
||||
}
|
||||
repoId := repo.Id
|
||||
if repoId == "" {
|
||||
repoId = fmt.Sprintf("repo-%d", i)
|
||||
}
|
||||
var urls []string
|
||||
if repo.BaseURL != "" {
|
||||
urls = []string{repo.BaseURL}
|
||||
|
|
@ -149,7 +156,9 @@ func main() {
|
|||
if repo.GPGKey != "" {
|
||||
keys = []string{repo.GPGKey}
|
||||
}
|
||||
|
||||
repos[i] = rpmmd.RepoConfig{
|
||||
Id: repoId,
|
||||
Name: repoName,
|
||||
BaseURLs: urls,
|
||||
Metalink: repo.Metalink,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue