diff --git a/pkg/config/utils.go b/pkg/config/utils.go index 4bbf6b334..bd916b2bb 100644 --- a/pkg/config/utils.go +++ b/pkg/config/utils.go @@ -40,9 +40,13 @@ func FindAllStackConfigsInPathsForStack( // TODO: review `doublestar` library matches, err = u.GetGlobMatches(pathWithExt) if err != nil { - y, _ := u.ConvertToYAML(cliConfig) - return nil, nil, false, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y) + if cliConfig.Logs.Level == u.LogLevelTrace { + y, _ := u.ConvertToYAML(cliConfig) + return nil, nil, false, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y) + } + return nil, nil, false, err } + } // Exclude files that match any of the excludePaths @@ -118,8 +122,11 @@ func FindAllStackConfigsInPaths( // TODO: review `doublestar` library matches, err = u.GetGlobMatches(pathWithExt) if err != nil { - y, _ := u.ConvertToYAML(cliConfig) - return nil, nil, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y) + if cliConfig.Logs.Level == u.LogLevelTrace { + y, _ := u.ConvertToYAML(cliConfig) + return nil, nil, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y) + } + return nil, nil, err } }