rpmmd/repository: repoconfig pointers
Convert some of the fields in the `RepoConfig` struct to pointers. Since `RepoConfig` will be used to convert custom repositories to an array of `osbuild.YumRepository`, we need to ensure that fields that are not set explicitly are not saved to the `/etc/yum.repos.d` repository files.
This commit is contained in:
parent
75e2138878
commit
d44703cdc8
14 changed files with 78 additions and 51 deletions
|
|
@ -17,6 +17,7 @@ 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"
|
||||
|
|
@ -203,8 +204,8 @@ func convertRepo(r repository) rpmmd.RepoConfig {
|
|||
Metalink: r.Metalink,
|
||||
MirrorList: r.MirrorList,
|
||||
GPGKeys: keys,
|
||||
CheckGPG: r.CheckGPG,
|
||||
CheckRepoGPG: false,
|
||||
CheckGPG: &r.CheckGPG,
|
||||
CheckRepoGPG: common.ToPtr(false),
|
||||
IgnoreSSL: false,
|
||||
MetadataExpire: r.MetadataExpire,
|
||||
RHSM: r.RHSM,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
|
||||
"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"
|
||||
|
|
@ -149,14 +150,16 @@ func main() {
|
|||
keys = []string{repo.GPGKey}
|
||||
}
|
||||
repos[i] = rpmmd.RepoConfig{
|
||||
Name: repoName,
|
||||
BaseURLs: urls,
|
||||
Metalink: repo.Metalink,
|
||||
MirrorList: repo.MirrorList,
|
||||
GPGKeys: keys,
|
||||
CheckGPG: repo.CheckGPG,
|
||||
PackageSets: repo.PackageSets,
|
||||
RHSM: repo.RHSM,
|
||||
Name: repoName,
|
||||
BaseURLs: urls,
|
||||
Metalink: repo.Metalink,
|
||||
MirrorList: repo.MirrorList,
|
||||
GPGKeys: keys,
|
||||
CheckGPG: &repo.CheckGPG,
|
||||
CheckRepoGPG: common.ToPtr(false),
|
||||
IgnoreSSL: false,
|
||||
PackageSets: repo.PackageSets,
|
||||
RHSM: repo.RHSM,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue