Skip to content

Commit

Permalink
data: make repositories available via go:embed
Browse files Browse the repository at this point in the history
This commit allows us to discover/load repositories via `go:embed`.
Note that unlike the `testrepos.go` code this one does not provide
a `New()` helper. Instead we will modify the `RepoRegistry` to
look 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 of
the current location and we can delete the repositories already
covered here (composer will still carry the `-no-aux-keys` repos
and the symlinks (which sadly cannot be expressed via go:embed)).
  • Loading branch information
mvo5 committed Jan 8, 2025
1 parent 7bcbb76 commit 4f0210c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data/repositories/repos.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package repos

import (
"embed"
)

//go:embed *.json
var FS embed.FS

0 comments on commit 4f0210c

Please sign in to comment.