diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepository.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepository.java index 7d2c5478..325b8fbc 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepository.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepository.java @@ -46,7 +46,7 @@ public class SpringVaultEnvironmentRepository extends AbstractVaultEnvironmentRe super(request, watch, properties); this.keyValueTemplate = keyValueTemplate; if (properties.getKvVersion() == 2 && StringUtils.hasText(properties.getPathToKey())) { - path = "data/" + properties.getPathToKey() + "/"; + path = properties.getPathToKey() + "/"; } this.objectMapper = new ObjectMapper(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryTests.java index 9297de36..f9546b7c 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryTests.java @@ -64,7 +64,7 @@ public class SpringVaultEnvironmentRepositoryTests { private void defaultKeyTest(String myPathKey, int version) { String path = ""; if (StringUtils.hasText(myPathKey) && version == 2) { - path = "data/" + myPathKey + "/"; + path = myPathKey + "/"; } VaultKeyValueOperations keyValueTemplate = mock(VaultKeyValueOperations.class); when(keyValueTemplate.get(path + "myapp")).thenReturn(withVaultResponse("foo", "bar"));