diff --git a/go.mod b/go.mod index 934c20171..6170948cd 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/labstack/gommon v0.4.2 github.com/openshift-online/ocm-sdk-go v0.1.438 github.com/oracle/oci-go-sdk/v54 v54.0.0 - github.com/osbuild/images v0.115.0 + github.com/osbuild/images v0.116.0 github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d github.com/osbuild/pulp-client v0.1.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 673fafe85..bfdb1815e 100644 --- a/go.sum +++ b/go.sum @@ -547,8 +547,8 @@ github.com/openshift-online/ocm-sdk-go v0.1.438 h1:tsLCCUzbLCTL4RZG02y9RuopmGCXp github.com/openshift-online/ocm-sdk-go v0.1.438/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= github.com/oracle/oci-go-sdk/v54 v54.0.0 h1:CDLjeSejv2aDpElAJrhKpi6zvT/zhZCZuXchUUZ+LS4= github.com/oracle/oci-go-sdk/v54 v54.0.0/go.mod h1:+t+yvcFGVp+3ZnztnyxqXfQDsMlq8U25faBLa+mqCMc= -github.com/osbuild/images v0.115.0 h1:csbuYb7N8T/HsccbUBmf1CF0pL2g3lj6QNc4tIru5EQ= -github.com/osbuild/images v0.115.0/go.mod h1:TzlPk6joWb7YhmA9oYSNU4aGeaHwcKxp8nvgoNaR3Lw= +github.com/osbuild/images v0.116.0 h1:jByGxKjpC4DthZ++P13aRimn4ZmwigTJ8SL9T/bTwvM= +github.com/osbuild/images v0.116.0/go.mod h1:TzlPk6joWb7YhmA9oYSNU4aGeaHwcKxp8nvgoNaR3Lw= github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d h1:r9BFPDv0uuA9k1947Jybcxs36c/pTywWS1gjeizvtcQ= github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20240814102216-0239db53236d/go.mod h1:zR1iu/hOuf+OQNJlk70tju9IqzzM4ycq0ectkFBm94U= github.com/osbuild/pulp-client v0.1.0 h1:L0C4ezBJGTamN3BKdv+rKLuq/WxXJbsFwz/Hj7aEmJ8= diff --git a/vendor/github.com/osbuild/images/pkg/osbuild/monitor.go b/vendor/github.com/osbuild/images/pkg/osbuild/monitor.go index 72c8fdb61..c897923da 100644 --- a/vendor/github.com/osbuild/images/pkg/osbuild/monitor.go +++ b/vendor/github.com/osbuild/images/pkg/osbuild/monitor.go @@ -62,8 +62,15 @@ type Progress struct { // NewStatusScanner returns a StatusScanner that can parse osbuild // jsonseq monitor status messages func NewStatusScanner(r io.Reader) *StatusScanner { + scanner := bufio.NewScanner(r) + // osbuild can currently generate very long messages, the default + // 64kb is too small for e.g. the dracut stage (see also + // https://github.com/osbuild/osbuild/issues/1976). Increase for + // but to unblock us. + buf := make([]byte, 0, 512_000) + scanner.Buffer(buf, 512_000) return &StatusScanner{ - scanner: bufio.NewScanner(r), + scanner: scanner, contextMap: make(map[string]*contextJSON), stageContextMap: make(map[string]*stageContextJSON), } diff --git a/vendor/github.com/osbuild/images/pkg/reporegistry/error.go b/vendor/github.com/osbuild/images/pkg/reporegistry/error.go index 7e0938d7f..34e7bb080 100644 --- a/vendor/github.com/osbuild/images/pkg/reporegistry/error.go +++ b/vendor/github.com/osbuild/images/pkg/reporegistry/error.go @@ -1,13 +1,17 @@ package reporegistry -import "fmt" +import ( + "fmt" + "io/fs" +) // NoReposLoadedError is an error type that is returned when no repositories // are loaded from the given paths. type NoReposLoadedError struct { Paths []string + FSes []fs.FS } func (e *NoReposLoadedError) Error() string { - return fmt.Sprintf("no repositories found in the given paths: %v", e.Paths) + return fmt.Sprintf("no repositories found in the given paths: %v/%v", e.Paths, e.FSes) } diff --git a/vendor/github.com/osbuild/images/pkg/reporegistry/reporegistry.go b/vendor/github.com/osbuild/images/pkg/reporegistry/reporegistry.go index 7a15e042a..7e796fd02 100644 --- a/vendor/github.com/osbuild/images/pkg/reporegistry/reporegistry.go +++ b/vendor/github.com/osbuild/images/pkg/reporegistry/reporegistry.go @@ -2,6 +2,7 @@ package reporegistry import ( "fmt" + "io/fs" "github.com/osbuild/images/pkg/distroidparser" "github.com/osbuild/images/pkg/rpmmd" @@ -14,10 +15,14 @@ type RepoRegistry struct { repos rpmmd.DistrosRepoConfigs } -// New returns a new RepoRegistry instance with the data -// loaded from the given repoConfigPaths -func New(repoConfigPaths []string) (*RepoRegistry, error) { - repositories, err := LoadAllRepositories(repoConfigPaths) +// New returns a new RepoRegistry instance with the data loaded from +// the given repoConfigPaths and repoConfigFS instance. The order is +// important here, first the paths are tried, then the FSes. +// +// Note that the confPaths must point directly to the directory with +// the json repo files. +func New(repoConfigPaths []string, repoConfigFS []fs.FS) (*RepoRegistry, error) { + repositories, err := loadAllRepositories(repoConfigPaths, repoConfigFS) if err != nil { return nil, err } diff --git a/vendor/github.com/osbuild/images/pkg/reporegistry/repository.go b/vendor/github.com/osbuild/images/pkg/reporegistry/repository.go index 4706724be..2104b6fb3 100644 --- a/vendor/github.com/osbuild/images/pkg/reporegistry/repository.go +++ b/vendor/github.com/osbuild/images/pkg/reporegistry/repository.go @@ -12,23 +12,24 @@ import ( "github.com/osbuild/images/pkg/rpmmd" ) -// LoadAllRepositories loads all repositories for given distros from the given list of paths. +// loadAllRepositories loads all repositories for given distros from the given list of paths. // Behavior is the same as with the LoadRepositories() method. -func LoadAllRepositories(confPaths []string) (rpmmd.DistrosRepoConfigs, error) { - var confFSes []fs.FS +func loadAllRepositories(confPaths []string, confFSes []fs.FS) (rpmmd.DistrosRepoConfigs, error) { + var mergedFSes []fs.FS for _, confPath := range confPaths { - confFSes = append(confFSes, os.DirFS(filepath.Join(confPath, "repositories"))) + mergedFSes = append(mergedFSes, os.DirFS(confPath)) } + mergedFSes = append(mergedFSes, confFSes...) - distrosRepoConfigs, err := LoadAllRepositoriesFromFS(confFSes) + distrosRepoConfigs, err := loadAllRepositoriesFromFS(mergedFSes) if len(distrosRepoConfigs) == 0 { - return nil, &NoReposLoadedError{confPaths} + return nil, &NoReposLoadedError{confPaths, confFSes} } return distrosRepoConfigs, err } -func LoadAllRepositoriesFromFS(confPaths []fs.FS) (rpmmd.DistrosRepoConfigs, error) { +func loadAllRepositoriesFromFS(confPaths []fs.FS) (rpmmd.DistrosRepoConfigs, error) { distrosRepoConfigs := rpmmd.DistrosRepoConfigs{} for _, confPath := range confPaths { @@ -89,13 +90,16 @@ func LoadAllRepositoriesFromFS(confPaths []fs.FS) (rpmmd.DistrosRepoConfigs, err // If there are duplicate distro repositories definitions found in multiple paths, the first // encounter is preferred. For this reason, the order of paths in the passed list should // reflect the desired preference. +// +// Note that the confPaths must point directly to the directory with +// the json repo files. func LoadRepositories(confPaths []string, distro string) (map[string][]rpmmd.RepoConfig, error) { var repoConfigs map[string][]rpmmd.RepoConfig - path := "/repositories/" + distro + ".json" + path := distro + ".json" for _, confPath := range confPaths { var err error - repoConfigs, err = rpmmd.LoadRepositoriesFromFile(confPath + path) + repoConfigs, err = rpmmd.LoadRepositoriesFromFile(filepath.Join(confPath, path)) if os.IsNotExist(err) { continue } else if err != nil { @@ -109,7 +113,7 @@ func LoadRepositories(confPaths []string, distro string) (map[string][]rpmmd.Rep } if repoConfigs == nil { - return nil, &NoReposLoadedError{confPaths} + return nil, &NoReposLoadedError{confPaths, nil} } return repoConfigs, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 97f4eb148..d3414880b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1034,7 +1034,7 @@ github.com/oracle/oci-go-sdk/v54/identity github.com/oracle/oci-go-sdk/v54/objectstorage github.com/oracle/oci-go-sdk/v54/objectstorage/transfer github.com/oracle/oci-go-sdk/v54/workrequests -# github.com/osbuild/images v0.115.0 +# github.com/osbuild/images v0.116.0 ## explicit; go 1.22.6 github.com/osbuild/images/data/repositories github.com/osbuild/images/internal/common