Skip to content

Commit ff92354

Browse files
committed
merge 3.1.x
2 parents 35ffe5d + 36c190e commit ff92354

File tree

15 files changed

+73
-99
lines changed

15 files changed

+73
-99
lines changed

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/ConfigMapPropertySourceLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Collection;
2323
import java.util.HashMap;
2424
import java.util.LinkedHashSet;
25+
import java.util.Locale;
2526
import java.util.Map;
2627
import java.util.Set;
2728
import java.util.function.Function;
@@ -120,7 +121,7 @@ private void addPropertySourcesFromPaths(Environment environment, CompositePrope
120121
}).toList().forEach(p -> {
121122
try {
122123
String content = new String(Files.readAllBytes(p)).trim();
123-
String filename = p.toAbsolutePath().toString().toLowerCase();
124+
String filename = p.toAbsolutePath().toString().toLowerCase(Locale.ROOT);
124125
if (filename.endsWith(".properties")) {
125126
addPropertySourceIfNeeded(c -> PROPERTIES_TO_MAP.apply(KEY_VALUE_TO_PROPERTIES.apply(c)), content,
126127
filename, composite);

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/SecretsPropertySourceLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.EnumSet;
2727
import java.util.HashSet;
2828
import java.util.List;
29+
import java.util.Locale;
2930
import java.util.Objects;
3031
import java.util.Set;
3132
import java.util.function.BiConsumer;
@@ -177,7 +178,7 @@ private SecretsPropertySource property(Path filePath) {
177178

178179
try {
179180
String content = new String(Files.readAllBytes(filePath)).trim();
180-
String sourceName = fileName.toLowerCase();
181+
String sourceName = fileName.toLowerCase(Locale.ROOT);
181182
SourceData sourceData = new SourceData(sourceName, Collections.singletonMap(fileName, content));
182183
return new SecretsPropertySource(sourceData);
183184
}

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-istio/src/test/java/org/springframework/cloud/kubernetes/fabric8/client/istio/Fabric8IstioIT.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.junit.jupiter.api.Assertions;
3030
import org.junit.jupiter.api.BeforeAll;
3131
import org.junit.jupiter.api.Test;
32+
import org.testcontainers.containers.Container;
3233
import org.testcontainers.k3s.K3sContainer;
3334
import reactor.netty.http.client.HttpClient;
3435
import reactor.util.retry.Retry;
@@ -42,8 +43,6 @@
4243
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
4344
import org.springframework.web.reactive.function.client.WebClient;
4445

45-
import static org.springframework.cloud.kubernetes.integration.tests.commons.Commons.processExecResult;
46-
4746
/**
4847
* @author wind57
4948
*/
@@ -89,9 +88,8 @@ static void beforeAll() throws Exception {
8988
}
9089

9190
@AfterAll
92-
static void afterAll() throws Exception {
91+
static void afterAll() {
9392
util.deleteNamespace("istio-system");
94-
Commons.cleanUp(IMAGE_NAME, K3S);
9593
}
9694

9795
@AfterAll
@@ -156,4 +154,12 @@ private static String istioctlPodName() {
156154
}
157155
}
158156

157+
private static String processExecResult(Container.ExecResult execResult) {
158+
if (execResult.getExitCode() != 0) {
159+
throw new RuntimeException("stdout=" + execResult.getStdout() + "\n" + "stderr=" + execResult.getStderr());
160+
}
161+
162+
return execResult.getStdout();
163+
}
164+
159165
}

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-client-reload/src/test/java/org/springframework/cloud/kubernetes/fabric8/client/reload/Fabric8EventReloadIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ static void beforeAll() throws Exception {
8080
}
8181

8282
@AfterAll
83-
static void afterAll() throws Exception {
83+
static void afterAll() {
8484
util.deleteNamespace("left");
8585
util.deleteNamespace("right");
86-
Commons.cleanUp(IMAGE_NAME, K3S);
8786

8887
manifests(Phase.DELETE);
8988
}

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-configuration-watcher/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ static void beforeAll() throws Exception {
7777
}
7878

7979
@AfterAll
80-
static void afterAll() throws Exception {
80+
static void afterAll() {
8181
configWatcher(Phase.DELETE);
82-
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
8382
}
8483

8584
@BeforeEach

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-configuration-watcher/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshMultipleNamespacesIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ static void beforeAll() throws Exception {
7777
}
7878

7979
@AfterAll
80-
static void afterAll() throws Exception {
80+
static void afterAll() {
8181
configWatcher(Phase.DELETE);
8282
util.wiremock(DEFAULT_NAMESPACE, "/", Phase.DELETE);
8383
util.deleteClusterWide(DEFAULT_NAMESPACE, Set.of(DEFAULT_NAMESPACE, LEFT_NAMESPACE, RIGHT_NAMESPACE));
8484
util.deleteNamespace(LEFT_NAMESPACE);
8585
util.deleteNamespace(RIGHT_NAMESPACE);
86-
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
8786
}
8887

8988
/**

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery-server/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientIT.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ static void beforeAll() throws Exception {
178178
static void afterAll() throws Exception {
179179
rbacApi.deleteClusterRoleBinding(clusterRoleBinding.getMetadata().getName(), null, null, null, null, null,
180180
null);
181-
Commons.cleanUp(DISCOVERY_SERVER_APP_NAME, K3S);
182-
Commons.cleanUp(SPRING_CLOUD_K8S_DISCOVERY_CLIENT_APP_NAME, K3S);
183-
184181
util.wiremock(NAMESPACE_LEFT, "/wiremock-" + NAMESPACE_LEFT, Phase.DELETE, false);
185182
util.wiremock(NAMESPACE_RIGHT, "/wiremock-" + NAMESPACE_RIGHT, Phase.DELETE, false);
186183

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery/src/test/java/org/springframework/cloud/kubernetes/k8s/client/discovery/KubernetesClientDiscoveryClientIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ static void beforeAll() throws Exception {
9090
}
9191

9292
@AfterAll
93-
static void afterAll() throws Exception {
93+
static void afterAll() {
9494
manifests(Phase.DELETE);
95-
Commons.cleanUp(IMAGE_NAME, K3S);
9695
}
9796

9897
/**

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-discovery/src/test/java/org/springframework/cloud/kubernetes/k8s/client/discovery/KubernetesClientDiscoverySelectiveNamespacesIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ static void beforeAll() throws Exception {
9494
}
9595

9696
@AfterAll
97-
static void afterAll() throws Exception {
98-
Commons.cleanUp(IMAGE_NAME, K3S);
99-
97+
static void afterAll() {
10098
util.wiremock(NAMESPACE, "/wiremock", Phase.DELETE, false);
10199
util.wiremock(NAMESPACE_A, "/wiremock", Phase.DELETE, false);
102100
util.wiremock(NAMESPACE_B, "/wiremock", Phase.DELETE, false);

spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-k8s-client-kafka-configmap-reload-multiple-apps/kafka-configmap-test-app/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/multiple/apps/ConfigurationWatcherMultipleAppsIT.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import io.kubernetes.client.openapi.models.V1Deployment;
2525
import io.kubernetes.client.openapi.models.V1Ingress;
2626
import io.kubernetes.client.openapi.models.V1Service;
27-
import org.junit.jupiter.api.AfterAll;
2827
import org.junit.jupiter.api.AfterEach;
2928
import org.junit.jupiter.api.Assertions;
3029
import org.junit.jupiter.api.BeforeAll;
@@ -84,13 +83,6 @@ static void beforeAll() throws Exception {
8483
util.setUp(NAMESPACE);
8584
}
8685

87-
@AfterAll
88-
static void afterAll() throws Exception {
89-
Commons.cleanUp(SPRING_CLOUD_K8S_CONFIG_WATCHER_APP_NAME, K3S);
90-
Commons.cleanUp(CONFIG_WATCHER_APP_A_IMAGE, K3S);
91-
Commons.cleanUp(CONFIG_WATCHER_APP_B_IMAGE, K3S);
92-
}
93-
9486
@BeforeEach
9587
void setup() {
9688
util.kafka(NAMESPACE, Phase.CREATE);

0 commit comments

Comments
 (0)