go.mod: update osbuild/images to v0.95.0

This commit is contained in:
Achilleas Koutsou 2024-10-29 09:21:28 +01:00 committed by Lukáš Zapletal
parent 69525b7ce6
commit 161a263b45
6 changed files with 22 additions and 9 deletions

View file

@ -0,0 +1,13 @@
package reporegistry
import "fmt"
// NoReposLoadedError is an error type that is returned when no repositories
// are loaded from the given paths.
type NoReposLoadedError struct {
Paths []string
}
func (e *NoReposLoadedError) Error() string {
return fmt.Sprintf("no repositories found in the given paths: %v", e.Paths)
}

View file

@ -23,9 +23,6 @@ func New(repoConfigPaths []string) (*RepoRegistry, error) {
if err != nil {
return nil, err
}
if len(repositories) == 0 {
return nil, fmt.Errorf("no repositories found in the given paths: %v", repoConfigPaths)
}
return &RepoRegistry{repositories}, nil
}

View file

@ -1,7 +1,6 @@
package reporegistry
import (
"fmt"
"log"
"os"
"path/filepath"
@ -66,6 +65,10 @@ func LoadAllRepositories(confPaths []string) (rpmmd.DistrosRepoConfigs, error) {
}
}
if len(distrosRepoConfigs) == 0 {
return nil, &NoReposLoadedError{confPaths}
}
return distrosRepoConfigs, nil
}
@ -93,7 +96,7 @@ func LoadRepositories(confPaths []string, distro string) (map[string][]rpmmd.Rep
}
if repoConfigs == nil {
return nil, fmt.Errorf("LoadRepositories failed: none of the provided paths contain distro configuration")
return nil, &NoReposLoadedError{confPaths}
}
return repoConfigs, nil

2
vendor/modules.txt vendored
View file

@ -1022,7 +1022,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.94.0
# github.com/osbuild/images v0.95.0
## explicit; go 1.21.0
github.com/osbuild/images/internal/common
github.com/osbuild/images/internal/environment