internal/rpmmd: RepoConfig baseurl change

Update the internal RepoConfig object to
accept a slice of baseurls rather than a
single field. This change was needed to
align RepoConfig with the dnf spec [1].

Additionally, this change adds custom json
marshal and unmarshal functions to ensure
backwards compatibility with older workers.
Add json tags to the internal rpmmd config
since this is serialized in dnfjson.
Add unit tests to check the serialization
is okay.

[1] See dnf.config
This commit is contained in:
Gianluca Zuccarelli 2023-01-23 16:07:21 +00:00 committed by Tomáš Hozza
parent 17d730593c
commit 4d42808b6a
23 changed files with 368 additions and 198 deletions

View file

@ -75,7 +75,7 @@ func executeTests(m *testing.M) int {
rr := reporegistry.NewFromDistrosRepoConfigs(rpmmd.DistrosRepoConfigs{
test_distro.TestDistroName: {
test_distro.TestArchName: {
{Name: "test-system-repo", BaseURL: "http://example.com/test/os/test_arch"},
{Name: "test-system-repo", BaseURLs: []string{"http://example.com/test/os/test_arch"}},
},
},
})