From 7a9ee89deddf86efcc42663cff03a523f58d5a18 Mon Sep 17 00:00:00 2001 From: stefano Date: Thu, 31 Oct 2019 16:51:33 +0000 Subject: [PATCH] modify watcher to watch jobs rather than pods --- .../src/main/groovy/net/corda/testing/PodAllocator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/net/corda/testing/PodAllocator.java b/buildSrc/src/main/groovy/net/corda/testing/PodAllocator.java index 8359698f85..7dc64678a8 100644 --- a/buildSrc/src/main/groovy/net/corda/testing/PodAllocator.java +++ b/buildSrc/src/main/groovy/net/corda/testing/PodAllocator.java @@ -76,11 +76,11 @@ public class PodAllocator { .sorted(Comparator.comparing(p -> p.getMetadata().getName())) .filter(foundPod -> foundPod.getMetadata().getName().contains(prefix)); - List> deleteFutures = jobsToDelete.map(job -> { - CompletableFuture result = new CompletableFuture<>(); - Watch watch = client.pods().inNamespace(job.getMetadata().getNamespace()).withName(job.getMetadata().getName()).watch(new Watcher() { + List> deleteFutures = jobsToDelete.map(job -> { + CompletableFuture result = new CompletableFuture<>(); + Watch watch = client.batch().jobs().inNamespace(job.getMetadata().getNamespace()).withName(job.getMetadata().getName()).watch(new Watcher() { @Override - public void eventReceived(Action action, Pod resource) { + public void eventReceived(Action action, Job resource) { if (action == Action.DELETED) { result.complete(resource); String msg = "Successfully deleted job " + job.getMetadata().getName();