Skip to content

Commit

Permalink
Use filter API that actually filters
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Jan 1, 2024
1 parent ddc4a6c commit 7a927d7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.TimeUnit;

@Service
Expand Down Expand Up @@ -60,10 +57,11 @@ public String spawnContainer(
) throws InterruptedException {
String imageName = "togetherjava.org:5001/togetherjava/jshellwrapper";
boolean presentLocally = client.listImagesCmd()
.withImageNameFilter(imageName)
.withFilter("reference", List.of(imageName))
.exec()
.stream()
.anyMatch(it -> Arrays.asList(it.getRepoTags()).contains("master"));
.flatMap(it -> Arrays.stream(it.getRepoTags()))
.anyMatch(it -> it.endsWith(":master"));

if (!presentLocally) {
client.pullImageCmd(imageName)
Expand Down

0 comments on commit 7a927d7

Please sign in to comment.