Merge pull request #1913 from wind57/correct_delete_of_services

remove services in correct order
This commit is contained in:
Ryan Baxter
2025-04-02 19:21:20 -04:00
committed by GitHub

View File

@@ -195,8 +195,8 @@ public final class Util {
public void deleteAndWait(String namespace, V1Deployment deployment, V1Service service) {
if (deployment != null) {
try {
try {
if (deployment != null) {
String deploymentName = deploymentName(deployment);
Map<String, String> podLabels = appsV1Api.readNamespacedDeployment(deploymentName, namespace, null)
.getSpec()
@@ -208,20 +208,19 @@ public final class Util {
labelSelector(podLabels), null, null, null, null, null, null, null, null);
waitForDeploymentToBeDeleted(deploymentName, namespace);
waitForDeploymentPodsToBeDeleted(podLabels, namespace);
}
if (service != null) {
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);
}
}
catch (Exception e) {
throw new RuntimeException(e);
waitForServiceToBeDeleted(service.getMetadata().getName(), namespace);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
public void busybox(String namespace, Phase phase) {