Config Server + Config Vault + Actuator = two beans with the same name
When we have
spring-cloud-config-server, spring-cloud-starter-vault-config and starter-actuator on the classpath we get the issue that the bean vaultTemplate is defined in SpringVaultClientConfiguration and in VaultAutoConfiguration. The application will not start unless we provide bean overriding.
It's enough to rename one of those beans to fix this.
I see vaultTemplate defined here https://github.com/spring-cloud/spring-cloud-vault/blob/main/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/VaultAutoConfiguration.java#L158
But SpringVaultClientConfiguration does not have any beans defined in it. I searched spring cloud config for anything named vaultTemplate but I did not find any beans with that name.
SpringVaultClientConfiguration extends AbstractVaultConfiguration. vaultTemplate is defined here.
The second one is indeed here.
But these are in Spring Vault Core and Spring Cloud Vault, so shouldn't the problem be resolved in one of those projects?
That's a very valid point ;) Let's transfer this to Spring Cloud Vault.