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

Fix 1278 #1280

Merged
merged 36 commits into from
Mar 31, 2023
Merged

Fix 1278 #1280

merged 36 commits into from
Mar 31, 2023

Conversation

wind57
Copy link
Contributor

@wind57 wind57 commented Mar 30, 2023

No description provided.

wind57 and others added 29 commits December 4, 2021 07:59
@@ -29,6 +32,7 @@
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty("spring.cloud.config.discovery.enabled")
@Import({ Fabric8AutoConfiguration.class, KubernetesDiscoveryClientAutoConfiguration.class })
@EnableConfigurationProperties({ KubernetesDiscoveryProperties.class, KubernetesClientProperties.class })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the core problem right here. this bootstrap imports two configurations:

  • Fabric8AutoConfiguration, which internally requires KubernetesClientProperties
  • KubernetesDiscoveryClientAutoConfiguration which internally requires KubernetesDiscoveryProperties

These work just fine on their own if used by auto-configuration only, but once we use bootstrap annotations like @AutoConfigureBefore break.

The one change that I did not account for was the fact that before this change, we used to provide an explicit KubernetesDiscoveryProperties @Bean and I dropped it once I fixed that issue. Totally my mistake here.


The other one with KubernetesClientProperties was still present, but as said in the issue itself, we got very lucky that no one actually stepped on it.

It's kind of sad that I spent so much time thinking into not breaking anything once I make my changes, and it still happens...

@@ -0,0 +1,16 @@
spring:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added an integration test with bootstrap enabled, that should catch these kind of things in the future.

@wind57 wind57 marked this pull request as ready for review March 31, 2023 08:57
@wind57
Copy link
Contributor Author

wind57 commented Mar 31, 2023

@ryanjbaxter ready to be looked at. thank you.

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

Successfully merging this pull request may close these issues.

No qualifying bean of type KubernetesDiscoveryProperties when using spring-cloud-starter-bootstrap
3 participants