[RFC] data: copy all repositories from osbuild-composer
to images
#1112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an attempt to have my cake and eat it. In a nutshell:
the repos. They are still normal files but instead of getting
them from the
repositories/
subdir the files are nowpart of
vendor/github.com/osbuild/images/data/repositories
(i.e. we just modify the specfile to copy from there, otherwise
all the same logic)
which means it is possible to just "go run github.com/..image-builder-cli"
binaries
real files and then falling back to the buildin repos (not done yet) [1]
Except for (slightly) higher complexity I see no real downsides
currently, but maybe I'm in love too much with my idea, have
a (critical!) look please.
[1] Happy to fix reporegistry but I don't want to spend too much time
upfront if the idea is not liked
This commit moves the repositories from
osbuild-composer
toimages. The rational is that we need a central place to host
the repositories so that they can be shared between osbuild-composer
and image-builder-cli.
The other reason is that conceptually images is (arguably) be a
better place because it knows how to build osbuild manifests and
it can only build those for distro releases it knows about. The
filenames are already part of the API of images (as it derives
the distro name from the filename) and it is impossible to add
new distros (except maybe point releases) without also updateing
images to deal with the details of the new distro.
data: make repositories available via
go:embed
This commit allows us to discover/load repositories via
go:embed
.Note that unlike the
testrepos.go
code this one does not providea
New()
helper. Instead we will modify theRepoRegistry
tolook for the search paths for repo configuration first and then
fallback to the buildin repos (unless disabled via a flag).
Embedding also allows us an easy transition path in composer. The
rpm specfile will simply need to copy the repository data from
vendor/github.com/osbuild/images/data/repositories
instead ofthe current location and we can delete the repositories already
covered here (composer will still carry the
-no-aux-keys
reposand the symlinks (which sadly cannot be expressed via go:embed)).