diff --git a/internal/exec/vendor_utils.go b/internal/exec/vendor_utils.go index 0f95f12bb..e7d291619 100644 --- a/internal/exec/vendor_utils.go +++ b/internal/exec/vendor_utils.go @@ -131,9 +131,10 @@ func ReadAndProcessVendorConfigFile(cliConfig schema.CliConfiguration, vendorCon } foundVendorConfigFile := vendorConfigFile - // Look for the vendoring manifest in the current directory - if !u.FileExists(vendorConfigFile) { + foundVendorConfigFile, fileExists := u.SearchConfigFile(foundVendorConfigFile) + + if !fileExists { // Look for the vendoring manifest in the directory pointed to by the `base_path` setting in the `atmos.yaml` pathToVendorConfig := path.Join(cliConfig.BasePath, vendorConfigFile) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0a719d79b..63014bf4d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -338,11 +338,12 @@ func processConfigFile( path string, v *viper.Viper, ) (bool, error) { - if !u.FileExists(path) { + // Check if the config file exists + configPath, fileExists := u.SearchConfigFile(path) + if !fileExists { return false, nil } - - reader, err := os.Open(path) + reader, err := os.Open(configPath) if err != nil { return false, err } @@ -350,7 +351,7 @@ func processConfigFile( defer func(reader *os.File) { err := reader.Close() if err != nil { - u.LogWarning(cliConfig, fmt.Sprintf("error closing file '"+path+"'. "+err.Error())) + u.LogWarning(cliConfig, fmt.Sprintf("error closing file '"+configPath+"'. "+err.Error())) } }(reader)