Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ public void createNamespace(String name) {

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()
Expand All @@ -208,20 +208,19 @@ public void deleteAndWait(String namespace, V1Deployment deployment, V1Service s
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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was my mistake, of course. I was doing :

if (deployment != null) {

        if (service != null) { .... }
}

but for the external-name service, deployment is null, but service is not.

And obviously, I was not removing it. This PR corrects this mistake.

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) {
Expand Down
Loading