Closed mvo5 closed 1 week ago
Just a quick comment: I am not sure if distro.aliases
is the best name since we already have distro aliases, and it is a different thing:
From my PoV, the ability to add a new repo config file or a symlink is a feature. I have yet to look at the code, but I would keep the option to redefine the alias for the user (ideally, not compiled into the binary).
Just a quick comment: I am not sure if
distro.aliases
is the best name since we already have distro aliases, and it is a different thing: [..]
Oh, this super interesting - the only reason I am adding this is to avoid the symlink centos-9.json -> centos-stream-9.json
in the default repo configuration. If a distro_alias in the composer config fixes this equally nicely and we can drop the symlink none of the distro.alises
support is needed.
From my PoV, the ability to add a new repo config file or a symlink is a feature. I have yet to look at the code, but I would keep the option to redefine the alias for the user (ideally, not compiled into the binary).
Both the ability to add new repo config, symlinks and to mask existing repos would be preserved. The goal of what I'm doing is strictly about making it easier to share the default/canonical repos from composer across multiple projects (image-builder-cli in my specific case).
Moving back to "draft" as it seems people do not really like this idea very much so far. So I will think a bit more what else we can do.
Closing in favor of https://github.com/osbuild/images/pull/1038 that hopefully addresses the concerns here.
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 usinggo:embed
symlinks are not supported and we have currentlycentos-9.json -> centos-stream-9.json
in ourosbuild-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. theimage-builder
binary will be self-contained and one can do:directly without any further configuration. It also solves how to keep the default repository configuration between
osbuild-composer
andimage-builder-cli
in sync.reporegistry: remove duplication in LoadRepositories()
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.