Skip to content

Commit 6252def

Browse files
committed
repos: rename dataDirs->repoDirs
Make it more obvious that data dirs and repo dirs are distinct by renaming them. Thanks to Achilleas for the suggestion.
1 parent 1d25f78 commit 6252def

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/image-builder/repos.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"github.com/osbuild/images/pkg/rpmmd"
1212
)
1313

14-
// defaultDataDirs contains the default search paths to look for
14+
// defaultRepoDirs contains the default search paths to look for
1515
// repository data. They contain a bunch of json files of the form
1616
// "$distro_$version".json (but that is an implementation detail that
1717
// the "images" library takes care of).
18-
var defaultDataDirs = []string{
18+
var defaultRepoDirs = []string{
1919
"/etc/image-builder/repositories",
2020
"/usr/share/image-builder/repositories",
2121
}
@@ -59,14 +59,14 @@ func parseRepoURLs(repoURLs []string, what string) ([]rpmmd.RepoConfig, error) {
5959
}
6060

6161
func newRepoRegistryImpl(dataDir string, extraRepos []string) (*reporegistry.RepoRegistry, error) {
62-
var dataDirs []string
62+
var repoDirs []string
6363
if dataDir != "" {
64-
dataDirs = []string{filepath.Join(dataDir, "repositories")}
64+
repoDirs = []string{filepath.Join(dataDir, "repositories")}
6565
} else {
66-
dataDirs = defaultDataDirs
66+
repoDirs = defaultRepoDirs
6767
}
6868

69-
conf, err := reporegistry.LoadAllRepositories(dataDirs, []fs.FS{repos.FS})
69+
conf, err := reporegistry.LoadAllRepositories(repoDirs, []fs.FS{repos.FS})
7070
if err != nil {
7171
return nil, err
7272
}

0 commit comments

Comments
 (0)