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

common conditionals for reactive implementation #1514

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
fad373c
correct order
wind57 Nov 3, 2023
eb7a681
checkstyle
wind57 Nov 3, 2023
042e722
trigger
wind57 Nov 3, 2023
8efbd58
fix test
wind57 Nov 3, 2023
57fc9c3
trigger
wind57 Nov 4, 2023
598c46e
drop a record used internally only
wind57 Nov 4, 2023
f0c59c0
Merge branch 'align-fabric8-k8s-discovery-clients-part-1' into align-…
wind57 Nov 6, 2023
01165e6
dirty
wind57 Nov 6, 2023
952a5c9
dirty
wind57 Nov 6, 2023
edd5bd4
dirty
wind57 Nov 6, 2023
fa77594
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-3
wind57 Nov 7, 2023
a17e1c7
dirty
wind57 Nov 7, 2023
45ca67b
dirty
wind57 Nov 7, 2023
9ac791d
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-3
wind57 Nov 8, 2023
39dd56c
before tests and IT
wind57 Nov 8, 2023
1ffe776
started working on tests
wind57 Nov 8, 2023
f6a22e1
started working on tests
wind57 Nov 8, 2023
77da363
merge 3.0.x
wind57 Nov 8, 2023
dba5c67
added one more tests
wind57 Nov 10, 2023
8463067
before integration tests
wind57 Nov 10, 2023
f986628
fix checkstyle
wind57 Nov 10, 2023
847ae34
started work on integration tests
wind57 Nov 13, 2023
485e39e
integration tests
wind57 Nov 13, 2023
f0c3bcd
fix test
wind57 Nov 13, 2023
b2a56ac
fix test
wind57 Nov 14, 2023
c2039fd
checkstyle
wind57 Nov 14, 2023
80a0380
fix test
wind57 Nov 14, 2023
a7597c2
minor clean-up
wind57 Nov 14, 2023
1cd547f
fix test
wind57 Nov 14, 2023
1d5b5f1
Merge branch 'align-fabric8-k8s-discovery-clients-part-3' into align-…
wind57 Nov 14, 2023
29031f5
minor clean-up
wind57 Nov 14, 2023
e22960d
minor clean-up
wind57 Nov 14, 2023
897e006
dirty
wind57 Nov 14, 2023
6ba109a
dirty
wind57 Nov 14, 2023
3b9bdb7
minor clean-up
wind57 Nov 14, 2023
4cc7cdd
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-4
wind57 Nov 14, 2023
caec2bb
Merge branch 'align-fabric8-k8s-discovery-clients-part-4' into align-…
wind57 Nov 15, 2023
1ad2259
Merge branch 'align-fabric8-k8s-discovery-clients-part-5' into align-…
wind57 Nov 15, 2023
e2cec3c
checkstyle
wind57 Nov 15, 2023
1e38aee
Merge branch 'align-fabric8-k8s-discovery-clients-part-5' into align-…
wind57 Nov 15, 2023
6e5f667
formatting
wind57 Nov 15, 2023
2f8d744
before tests
wind57 Nov 15, 2023
ea90959
align
wind57 Nov 15, 2023
6464751
started work on tests
wind57 Nov 15, 2023
5acb6d7
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-5
wind57 Nov 15, 2023
a9428d6
trigger
wind57 Nov 15, 2023
c890a9a
Merge branch 'align-fabric8-k8s-discovery-clients-part-5' into align-…
wind57 Nov 15, 2023
44f6fa8
Merge branch 'align-fabric8-k8s-discovery-clients-part-6' into align-…
wind57 Nov 15, 2023
57a7280
formatting
wind57 Nov 15, 2023
3cf051d
Merge branch 'align-fabric8-k8s-discovery-clients-part-5' into align-…
wind57 Nov 15, 2023
f8b8d79
Merge branch 'align-fabric8-k8s-discovery-clients-part-6' into align-…
wind57 Nov 15, 2023
179d973
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-6
wind57 Nov 16, 2023
dd797dd
Merge branch 'align-fabric8-k8s-discovery-clients-part-6' into align-…
wind57 Nov 16, 2023
90b0445
wip
wind57 Nov 17, 2023
f933c45
wip
wind57 Nov 17, 2023
03541e2
merge 3.0.x
wind57 Nov 17, 2023
672516e
merge 3.0.x
wind57 Nov 17, 2023
d4f9582
tests added
wind57 Nov 17, 2023
e36b471
remove sout
wind57 Nov 17, 2023
bfc099b
fix
wind57 Nov 17, 2023
9723274
simplify
wind57 Nov 17, 2023
8ab264e
fix
wind57 Nov 17, 2023
87b87f7
started work
wind57 Nov 17, 2023
100c351
review comments
wind57 Nov 17, 2023
40e7983
merge 3.0.x
wind57 Nov 17, 2023
91ec941
Merge branch 'align-fabric8-k8s-discovery-clients-part-7' into align-…
wind57 Nov 18, 2023
2e005fe
before fixing tests
wind57 Nov 18, 2023
bf45bcc
dirty
wind57 Nov 18, 2023
8772e5c
started working on tests
wind57 Nov 18, 2023
48fd465
merge 3.0.x
wind57 Nov 18, 2023
dc47efa
add one annotation
wind57 Nov 18, 2023
f02d68e
Merge branch 'align-fabric8-k8s-discovery-clients-part-8' into align-…
wind57 Nov 18, 2023
d13dfc8
fix 1426
wind57 Nov 18, 2023
34cf51e
Merge branch 'align-fabric8-k8s-discovery-clients-part-9' into align-…
wind57 Nov 18, 2023
942a144
common annotation for all blocking discovery implementations
wind57 Nov 18, 2023
92c66ee
common annotation for all reactive discovery implementations
wind57 Nov 18, 2023
321c121
Merge branch '3.0.x' into align-fabric8-k8s-discovery-clients-part-11
wind57 Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.cloud.client.ConditionalOnDiscoveryHealthIndicatorEnabled;
import org.springframework.cloud.client.ConditionalOnReactiveDiscoveryEnabled;
import org.springframework.cloud.client.ReactiveCommonsClientAutoConfiguration;
import org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration;
import org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent;
Expand All @@ -48,7 +44,7 @@
import org.springframework.cloud.kubernetes.client.discovery.KubernetesInformerDiscoveryClient;
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
import org.springframework.cloud.kubernetes.commons.PodUtils;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnKubernetesDiscoveryEnabled;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesReactiveDiscovery;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryClientHealthIndicatorInitializer;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryPropertiesAutoConfiguration;
Expand All @@ -65,10 +61,7 @@
*/

@Configuration(proxyBeanMethods = false)
@ConditionalOnDiscoveryEnabled
@ConditionalOnKubernetesDiscoveryEnabled
@ConditionalOnReactiveDiscoveryEnabled
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
@ConditionalOnSpringCloudKubernetesReactiveDiscovery
@AutoConfigureBefore({ SimpleReactiveDiscoveryClientAutoConfiguration.class,
ReactiveCommonsClientAutoConfiguration.class })
@AutoConfigureAfter({ ReactiveCompositeDiscoveryClientAutoConfiguration.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2013-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.cloud.kubernetes.commons.discovery;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.cloud.client.ConditionalOnReactiveDiscoveryEnabled;

/**
* Provides common conditionals to be used for reactive discovery.
*
* @author wind57
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@ConditionalOnDiscoveryEnabled
@ConditionalOnKubernetesDiscoveryEnabled
@ConditionalOnReactiveDiscoveryEnabled
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
public @interface ConditionalOnSpringCloudKubernetesReactiveDiscovery {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we just did this work for blocking discovery, now for reactive. Nothing else changes in this PR


}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@
package org.springframework.cloud.kubernetes.discovery;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.cloud.client.ConditionalOnDiscoveryHealthIndicatorEnabled;
import org.springframework.cloud.client.ConditionalOnReactiveDiscoveryEnabled;
import org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent;
import org.springframework.cloud.client.discovery.health.DiscoveryClientHealthIndicatorProperties;
import org.springframework.cloud.client.discovery.health.reactive.ReactiveDiscoveryClientHealthIndicator;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnKubernetesDiscoveryEnabled;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesReactiveDiscovery;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -37,10 +33,7 @@
* @author wind57
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnDiscoveryEnabled
@ConditionalOnKubernetesDiscoveryEnabled
@ConditionalOnReactiveDiscoveryEnabled
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
@ConditionalOnSpringCloudKubernetesReactiveDiscovery
@EnableConfigurationProperties({ DiscoveryClientHealthIndicatorProperties.class,
KubernetesDiscoveryClientProperties.class })
class KubernetesDiscoveryClientReactiveAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.cloud.client.ConditionalOnDiscoveryHealthIndicatorEnabled;
import org.springframework.cloud.client.ConditionalOnReactiveDiscoveryEnabled;
import org.springframework.cloud.client.ReactiveCommonsClientAutoConfiguration;
import org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration;
import org.springframework.cloud.client.discovery.health.DiscoveryClientHealthIndicatorProperties;
import org.springframework.cloud.client.discovery.health.reactive.ReactiveDiscoveryClientHealthIndicator;
import org.springframework.cloud.client.discovery.simple.reactive.SimpleReactiveDiscoveryClientAutoConfiguration;
import org.springframework.cloud.kubernetes.commons.PodUtils;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnKubernetesDiscoveryEnabled;
import org.springframework.cloud.kubernetes.commons.discovery.ConditionalOnSpringCloudKubernetesReactiveDiscovery;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryClientHealthIndicatorInitializer;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryProperties;
import org.springframework.cloud.kubernetes.commons.discovery.KubernetesDiscoveryPropertiesAutoConfiguration;
Expand All @@ -53,10 +49,7 @@
* @author Tim Ysewyn
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnDiscoveryEnabled
@ConditionalOnKubernetesDiscoveryEnabled
@ConditionalOnReactiveDiscoveryEnabled
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
@ConditionalOnSpringCloudKubernetesReactiveDiscovery
@AutoConfigureBefore({ SimpleReactiveDiscoveryClientAutoConfiguration.class,
ReactiveCommonsClientAutoConfiguration.class })
@AutoConfigureAfter({ ReactiveCompositeDiscoveryClientAutoConfiguration.class,
Expand Down
Loading