Skip to content

Commit 2183756

Browse files
committed
review comments
Signed-off-by: wind57 <[email protected]>
1 parent 53fc3b2 commit 2183756

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

spring-cloud-kubernetes-fabric8-discovery/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@
4949
</dependency>
5050

5151
<!-- Testing Dependencies -->
52-
53-
<dependency>
54-
<groupId>org.springframework.cloud</groupId>
55-
<artifactId>spring-cloud-kubernetes-fabric8-config</artifactId>
56-
<scope>test</scope>
57-
</dependency>
58-
5952
<dependency>
6053
<groupId>org.springframework.boot</groupId>
6154
<artifactId>spring-boot-starter-test</artifactId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2013-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.kubernetes;
18+
19+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
20+
import org.springframework.boot.context.config.ConfigDataLocation;
21+
import org.springframework.boot.context.config.ConfigDataLocationResolverContext;
22+
import org.springframework.boot.context.config.Profiles;
23+
import org.springframework.boot.logging.DeferredLogFactory;
24+
import org.springframework.cloud.kubernetes.commons.KubernetesNamespaceProvider;
25+
import org.springframework.cloud.kubernetes.commons.config.KubernetesConfigDataLocationResolver;
26+
27+
/**
28+
* @author wind57
29+
*/
30+
@ConditionalOnProperty(value = "dummy.config.loader.enabled", havingValue = "true", matchIfMissing = false)
31+
class DummyConfigDataLocationResolver extends KubernetesConfigDataLocationResolver {
32+
33+
DummyConfigDataLocationResolver(DeferredLogFactory factory) {
34+
super(factory);
35+
}
36+
37+
@Override
38+
protected void registerBeans(ConfigDataLocationResolverContext resolverContext, ConfigDataLocation location,
39+
Profiles profiles, PropertyHolder propertyHolder, KubernetesNamespaceProvider namespaceProvider) {
40+
41+
}
42+
43+
}

spring-cloud-kubernetes-fabric8-discovery/src/test/java/org/springframework/cloud/kubernetes/fabric8/discovery/Fabric8ConfigServerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
*
4242
* @author wind57
4343
*/
44-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
45-
"spring.main.cloud-platform=KUBERNETES", "spring.config.import=kubernetes:, optional:configserver:" })
44+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
45+
properties = { "spring.main.cloud-platform=KUBERNETES",
46+
"spring.config.import=kubernetes:, optional:configserver:", "dummy.config.loader.enabled=true" })
4647
class Fabric8ConfigServerTest {
4748

4849
private static WireMockServer wireMockServer;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.springframework.boot.context.config.ConfigDataLocationResolver=\
2+
org.springframework.cloud.kubernetes.DummyConfigDataLocationResolver

0 commit comments

Comments
 (0)