fix(fetcher): handle all os.Stat() errors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Markus Pesch 2024-12-03 11:09:34 +01:00
parent 37de3302c6
commit f2dc3d5174
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -75,7 +75,7 @@ func getDockerComposeViaHTTP(url string) (*dockerCompose.Config, error) {
func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) { func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
fileStat, err := os.Stat(name) fileStat, err := os.Stat(name)
switch { switch {
case errors.Is(err, os.ErrNotExist): case err != nil:
return nil, err return nil, err
case fileStat.IsDir(): case fileStat.IsDir():
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name) return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)