mirror of
https://github.com/corda/corda.git
synced 2024-12-20 05:28:21 +00:00
modify watcher to watch jobs rather than pods
This commit is contained in:
parent
bd9d8dbdbd
commit
7a9ee89ded
@ -76,11 +76,11 @@ public class PodAllocator {
|
||||
.sorted(Comparator.comparing(p -> p.getMetadata().getName()))
|
||||
.filter(foundPod -> foundPod.getMetadata().getName().contains(prefix));
|
||||
|
||||
List<CompletableFuture<Pod>> deleteFutures = jobsToDelete.map(job -> {
|
||||
CompletableFuture<Pod> result = new CompletableFuture<>();
|
||||
Watch watch = client.pods().inNamespace(job.getMetadata().getNamespace()).withName(job.getMetadata().getName()).watch(new Watcher<Pod>() {
|
||||
List<CompletableFuture<Job>> deleteFutures = jobsToDelete.map(job -> {
|
||||
CompletableFuture<Job> result = new CompletableFuture<>();
|
||||
Watch watch = client.batch().jobs().inNamespace(job.getMetadata().getNamespace()).withName(job.getMetadata().getName()).watch(new Watcher<Job>() {
|
||||
@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();
|
||||
|
Loading…
Reference in New Issue
Block a user