spring-cloud / spring-cloud-vault

Configuration Integration with HashiCorp Vault
http://cloud.spring.io/spring-cloud-vault/
Apache License 2.0
274 stars 152 forks source link

Vault health indicator missing from the /health endpoint #574

Closed M3hdi closed 3 years ago

M3hdi commented 3 years ago

Issue :

The Vault health indicator missing from spring's actuator /health endpoint The issue is reproducible with the following versions :

Auto-configuration debug output :

   VaultHealthIndicatorAutoConfiguration:
      Did not match:
         - @ConditionalOnBean (types: org.springframework.cloud.vault.config.VaultBootstrapConfiguration; SearchStrategy: all) did not find any beans of type org.springframework.cloud.vault.config.VaultBootstrapConfiguration (OnBeanCondition)
      Matched:
         - @ConditionalOnClass found required class 'org.springframework.boot.actuate.health.HealthIndicator' (OnClassCondition)
         - @ConditionalOnProperty (spring.cloud.vault.enabled) matched (OnPropertyCondition)
         - @ConditionalOnEnabledHealthIndicator management.health.defaults.enabled is considered true (OnEnabledHealthIndicatorCondition)

The vault health contributor configuration did not match due to no beans of type VaultBootstrapConfiguration being present in the context.

Shouldn't the "@ConditionalOnBean(VaultBootstrapConfiguration.class)" in VaultHealthIndicatorAutoConfiguration be removed since the class VaultBootstrapConfiguration was marked as deprecated since 3.0 ?

mp911de commented 3 years ago

Thanks for reporting the issue. We need to make it conditional on VaultOperations and make sure it runs after the actual Vault configuration.