list-images: add --datadir override for e.g. custom repositories#2
list-images: add --datadir override for e.g. custom repositories#2mvo5 merged 1 commit intoosbuild:mainfrom
Conversation
58c1bfe to
6edc7f3
Compare
|
Do we expect the datadir to contain other types of data in the future, beyond just repositories? If this is strictly meant for repo configs, maybe the CLI flag name should reflect that? |
6edc7f3 to
10e2eed
Compare
Thank you, it's a very good question. I started with --repository-dir but then "images" in "reporegistry" will automatically append "repositories" to the "conf-path" (c.f. https://github.com/osbuild/images/blob/main/pkg/reporegistry/repository.go#L21) - which makes it a bit awkward because this naive usage |
ah, I see. In that case I don't have any good ideas for what else it might include. Perhaps some defaults for how osbuild is run in a |
This commit adds a `--datadir` override that allows overriding the default search paths for e.g. the custom repositories. In practise only repository overrides are supported because that is the only data stored there.
10e2eed to
9d86006
Compare
|
@achilleas-k Thanks! I tweaked one tiny detail and made "--datadir" a persistent flag as this will also be useful for |
[I'm not 100% certain about this tbh, it feels a bit inelegant but it seems a super common request to be able to have a --repositores overrride switch - I initially added --repositories but that feels a bit akward as it needs to point to the parent of the repositories/ directory so I name it --datadir. I guess alternatively we could define a
--repository /path/to/repositories/actual-file.jsonand leave it to the user to pick the right one, I'm not sure which is nicer as I'm not sure what the use-case is]This commit adds a
--datadiroverride that allows overridingthe default search paths for e.g. the custom repositories. In
practise only repository overrides are supported because that
is the only data stored there.