@@ -132,7 +132,7 @@ public final class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteAndWait(String namespace, @Nullable Deployment deployment, Service service) {
|
||||
public void deleteAndWait(String namespace, @Nullable Deployment deployment, @Nullable Service service) {
|
||||
try {
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
@@ -150,8 +150,10 @@ public final class Util {
|
||||
}
|
||||
System.out.println("Ended deployment delete in " + (System.currentTimeMillis() - startTime) + "ms");
|
||||
|
||||
client.services().inNamespace(namespace).resource(service).delete();
|
||||
waitForServiceToBeDeleted(namespace, service);
|
||||
if (service != null) {
|
||||
client.services().inNamespace(namespace).resource(service).delete();
|
||||
waitForServiceToBeDeleted(namespace, service);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
@@ -209,10 +209,13 @@ public final class Util {
|
||||
waitForDeploymentToBeDeleted(deploymentName, namespace);
|
||||
waitForDeploymentPodsToBeDeleted(podLabels, namespace);
|
||||
|
||||
service.getMetadata().setNamespace(namespace);
|
||||
coreV1Api.deleteNamespacedService(service.getMetadata().getName(), service.getMetadata().getNamespace(),
|
||||
if (service != null) {
|
||||
service.getMetadata().setNamespace(namespace);
|
||||
coreV1Api.deleteNamespacedService(service.getMetadata().getName(), service.getMetadata().getNamespace(),
|
||||
null, null, null, null, null, null);
|
||||
waitForServiceToBeDeleted(service.getMetadata().getName(), namespace);
|
||||
waitForServiceToBeDeleted(service.getMetadata().getName(), namespace);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user