Skip to content

Commit

Permalink
Add debug..
Browse files Browse the repository at this point in the history
  • Loading branch information
BarDweller committed Jul 5, 2024
1 parent 8e0fad9 commit 89d2772
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.github.dockerjava.api.command.PullImageResultCallback;
import com.github.dockerjava.api.model.Image;
import com.github.dockerjava.api.exception.DockerClientException;
import com.github.dockerjava.api.exception.NotFoundException;

import dev.snowdrop.buildpack.config.DockerConfig;
import dev.snowdrop.buildpack.BuildpackException;
Expand Down Expand Up @@ -76,20 +77,24 @@ public static void pullImages(DockerConfig config, String... imageNames) {
}

// wait for pulls to complete.
DockerClientException lastSeen = null;
RuntimeException lastSeen = null;
boolean allDone = true;
while(!allDone && retriesRemaining>=0){
allDone = true;
for (Entry<String, PullImageResultCallback> e : pircMap.entrySet()) {
boolean done = false;
try {
if(e.getValue()==null) continue;
log.debug("waiting on image "+e.getKey());
done = e.getValue().awaitCompletion(config.getPullTimeout(), TimeUnit.SECONDS);
log.debug("success for image "+e.getKey());
} catch (InterruptedException ie) {
throw BuildpackException.launderThrowable(ie);
} catch (DockerClientException dce) {
//error occurred during pull for this pirc, need to pause & retry the pull op
lastSeen = dce;
} catch (NotFoundException nfe) {
lastSeen = nfe;
}
if(!done){
String imageName = e.getKey();
Expand Down

0 comments on commit 89d2772

Please sign in to comment.