squakez commented on code in PR #15063:
URL: https://github.com/apache/camel/pull/15063#discussion_r1711237173
##########
core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java:
##########
@@ -433,6 +448,43 @@ private Properties tryLoadProperties(
return ip;
}
+ private static Properties tryLoadCloudProperties(
+ Properties overridProperties, String cloudPropertiesLocations)
+ throws IOException {
+
+ final Properties cp = new Properties();
+ try {
+ String[] locations = cloudPropertiesLocations.split(",");
+ for (String loc : locations) {
+ Path confPath = Paths.get(loc);
+ if (Files.exists(confPath) && Files.isDirectory(confPath)) {
+ Files.walkFileTree(confPath, new SimpleFileVisitor<Path>()
{
+ @Override
+ public FileVisitResult visitFile(Path file,
BasicFileAttributes attrs) {
+ if (!Files.isDirectory(file)) {
+ try {
+ String val = new
String(Files.readAllBytes(file));
+ cp.put(file.getFileName().toString(), val);
+ } catch (IOException e) {
+ // Do nothing or should we throw a
RuntimeException?
Review Comment:
No, there is no easy way to check that. However, given the user is setting
this configuration on purpose, should be aware of what he/she is doing. As it's
an auto configuration I'd be more inclined to just skip the failing
configuration, maybe adding a log line to report that.
The file name is not expected. Typically, the file name is straight from the
secret/configmap key. In the unit test I had to add a .txt as there was some
maven process running validation and looking for licenses. However, it should
work correctly without file extension.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]