Config Server + Config Vault + Actuator = two beans with the same name · Issue #740 · spring-cloud/spring-cloud-vault · GitHub
Skip to content

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

Open

Description

@marcingrzejszczak

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.

Activity

  1. ryanjbaxter commented on Dec 18, 2024

    @ryanjbaxter
    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.

  2. marcingrzejszczak commented on Dec 19, 2024

    @marcingrzejszczak
    ContributorAuthor

    SpringVaultClientConfiguration extends AbstractVaultConfiguration. vaultTemplate is defined here.

    The second one is indeed here.

  3. ryanjbaxter commented on Dec 19, 2024

    @ryanjbaxter
    Contributor

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

  4. marcingrzejszczak commented on Dec 19, 2024

    @marcingrzejszczak
    ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions