Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Server + Config Vault + Actuator = two beans with the same name #740

Open
marcingrzejszczak opened this issue Dec 18, 2024 · 4 comments

Comments

@marcingrzejszczak
Copy link
Contributor

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.

@ryanjbaxter
Copy link
Contributor

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.

@marcingrzejszczak
Copy link
Contributor Author

SpringVaultClientConfiguration extends AbstractVaultConfiguration. vaultTemplate is defined here.

The second one is indeed here.

@ryanjbaxter
Copy link
Contributor

But these are in Spring Vault Core and Spring Cloud Vault, so shouldn't the problem be resolved in one of those projects?

@marcingrzejszczak
Copy link
Contributor Author

That's a very valid point ;) Let's transfer this to Spring Cloud Vault.

@marcingrzejszczak marcingrzejszczak transferred this issue from spring-cloud/spring-cloud-config Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants