Skip to content

Commit

Permalink
Merge pull request #232 from jfdenise/master
Browse files Browse the repository at this point in the history
Do not scan configMap sub directories
  • Loading branch information
radcortez authored Feb 5, 2020
2 parents 4bd6e15 + 25f35ed commit 12f917a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ public FileSystemConfigSource(File dir, int ordinal) {

private static Map<String, String> scan(File directory) {
if (directory != null && directory.isDirectory()) {
try (Stream<Path> stream = Files.walk(directory.toPath())) {
try (Stream<Path> stream = Files.walk(directory.toPath(), 1)) {

return stream.filter(p -> p.toFile().isFile())
.collect(Collectors.toMap(it -> it.getFileName().toString(), FileSystemConfigSource::readContent));
} catch (Exception e) {
LOG.warnf("Unable to read content from file %s", directory.getAbsolutePath());
LOG.warnf("Unable to read content from file %s. Exception: %s", directory.getAbsolutePath(),
e.getLocalizedMessage());
}
}
return Collections.emptyMap();
Expand Down

0 comments on commit 12f917a

Please sign in to comment.