Skip to content

Commit 0efc240

Browse files
committed
fix
Signed-off-by: wind57 <[email protected]>
1 parent a9fd87b commit 0efc240

File tree

1 file changed

+10
-11
lines changed
  • spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client

1 file changed

+10
-11
lines changed

spring-cloud-kubernetes-test-support/src/main/java/org/springframework/cloud/kubernetes/integration/tests/commons/native_client/Util.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ public void createNamespace(String name) {
195195

196196
public void deleteAndWait(String namespace, V1Deployment deployment, V1Service service) {
197197

198-
if (deployment != null) {
199-
try {
198+
try {
199+
if (deployment != null) {
200200
String deploymentName = deploymentName(deployment);
201201
Map<String, String> podLabels = appsV1Api.readNamespacedDeployment(deploymentName, namespace, null)
202202
.getSpec()
@@ -208,20 +208,19 @@ public void deleteAndWait(String namespace, V1Deployment deployment, V1Service s
208208
labelSelector(podLabels), null, null, null, null, null, null, null, null);
209209
waitForDeploymentToBeDeleted(deploymentName, namespace);
210210
waitForDeploymentPodsToBeDeleted(podLabels, namespace);
211+
}
211212

212-
if (service != null) {
213-
service.getMetadata().setNamespace(namespace);
214-
coreV1Api.deleteNamespacedService(service.getMetadata().getName(), service.getMetadata().getNamespace(),
213+
if (service != null) {
214+
service.getMetadata().setNamespace(namespace);
215+
coreV1Api.deleteNamespacedService(service.getMetadata().getName(), service.getMetadata().getNamespace(),
215216
null, null, null, null, null, null);
216-
waitForServiceToBeDeleted(service.getMetadata().getName(), namespace);
217-
}
218-
219-
}
220-
catch (Exception e) {
221-
throw new RuntimeException(e);
217+
waitForServiceToBeDeleted(service.getMetadata().getName(), namespace);
222218
}
223219

224220
}
221+
catch (Exception e) {
222+
throw new RuntimeException(e);
223+
}
225224
}
226225

227226
public void busybox(String namespace, Phase phase) {

0 commit comments

Comments
 (0)