diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapPropertySourceLocator.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapPropertySourceLocator.java index 1ca300b5b..7c2688472 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapPropertySourceLocator.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapPropertySourceLocator.java @@ -22,6 +22,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.function.Function; @@ -120,7 +121,7 @@ private void addPropertySourcesFromPaths(Environment environment, CompositePrope }).toList().forEach(p -> { try { String content = new String(Files.readAllBytes(p)).trim(); - String filename = p.toAbsolutePath().toString().toLowerCase(); + String filename = p.toAbsolutePath().toString().toLowerCase(Locale.ROOT); if (filename.endsWith(".properties")) { addPropertySourceIfNeeded(c -> PROPERTIES_TO_MAP.apply(KEY_VALUE_TO_PROPERTIES.apply(c)), content, filename, composite); diff --git a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsPropertySourceLocator.java b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsPropertySourceLocator.java index 2eb33c801..ca954a6ef 100644 --- a/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsPropertySourceLocator.java +++ b/spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsPropertySourceLocator.java @@ -26,6 +26,7 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Objects; import java.util.Set; import java.util.function.BiConsumer; @@ -177,7 +178,7 @@ private SecretsPropertySource property(Path filePath) { try { String content = new String(Files.readAllBytes(filePath)).trim(); - String sourceName = fileName.toLowerCase(); + String sourceName = fileName.toLowerCase(Locale.ROOT); SourceData sourceData = new SourceData(sourceName, Collections.singletonMap(fileName, content)); return new SecretsPropertySource(sourceData); }