reporegistry: support loading repos from fs.FS#1037
Closed
mvo5 wants to merge 4 commits intoosbuild:mainfrom
Closed
reporegistry: support loading repos from fs.FS#1037mvo5 wants to merge 4 commits intoosbuild:mainfrom
mvo5 wants to merge 4 commits intoosbuild:mainfrom
Conversation
This commit removes some directory traversal duplication from LoadRepositories() on the expense of more "expensive" repo loading. The new code will just always load all repos and return the one matching the distro. The advantage of this approach is that when aliases are introduced there is only a single code path that needs changing.
This commit introduces a new `distro.aliases` file that replaces the role of the existing symlinks to provide an alias name for a distro. The reason is that when using `go:embed` symlinks are not supported and we have currently `centos-9.json -> centos-stream-9.json` in our `osbuild-comopser` distro definitions. By moving them from symlinks to alias files we can start using `go:embed` which is nice for the daemonless work, i.e. the `image-builder` binary will be self-contained and one can do: ``` $ go run github.com/osbuild/image-builder/cmd/image-builder --list-images ``` directly without any further configuration. It also solves how to keep the default repository configuration between `osbuild-composer` and `image-builder-cli` in sync.
This is a first step towards loading repositories via `go:embed` and fully compatible with the old way of loading repos.
mvo5
added a commit
to mvo5/images
that referenced
this pull request
Nov 12, 2024
This commit is a (hopefully) less controversial version of: osbuild#1037 Here only a new helper to load repository information from an `fs.FS` is added and only used for loading the test repositories. This will help to have a single test repository that can be embedded accross osbuild-composer, image-builder and images. It also removes the public "NewTestedDefault()" in favor of a new `testrepos.New()` helper so that the `reporegistry` only has non-test API left.
Contributor
Author
|
Closing in favor of #1038 |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 16, 2024
This commit is a (hopefully) less controversial version of: #1037 Here only a new helper to load repository information from an `fs.FS` is added and only used for loading the test repositories. This will help to have a single test repository that can be embedded accross osbuild-composer, image-builder and images. It also removes the public "NewTestedDefault()" in favor of a new `testrepos.New()` helper so that the `reporegistry` only has non-test API left.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[based on https://github.com//pull/1036 and draft because it need 1036 and a tweak in osbuild-composer to make the repos there embeddable - mostly here so that people can see where this is heading]
reporegistry: support loading repos from fs.FS
This is a first step towards loading repositories via
go:embedand fully compatible with the old way of loading repos.