use of org.eclipse.jkube.kit.build.service.docker.access.DockerAccessException in project jkube by eclipse.
the class DockerAccessWithHcClientTest method testLoadImageFail.
@Test
public void testLoadImageFail() throws IOException {
givenAnImageName("test");
givenArchiveFile("test.tar");
givenThePostWillFail();
DockerAccessException dockerAccessException = assertThrows(DockerAccessException.class, () -> client.loadImage(imageName, new File(archiveFile)));
assertThat(dockerAccessException).isNotNull();
}
use of org.eclipse.jkube.kit.build.service.docker.access.DockerAccessException in project jkube by eclipse.
the class DockerAccessWithHcClientTest method testPushFailes_noRetry.
@Test
public void testPushFailes_noRetry() throws Exception {
givenAnImageName("test");
givenThePushWillFail(0);
DockerAccessException dae = assertThrows(DockerAccessException.class, this::whenPushImage);
assertThat(dae).isNotNull();
}
use of org.eclipse.jkube.kit.build.service.docker.access.DockerAccessException in project jkube by eclipse.
the class HealthCheckChecker method check.
@Override
public boolean check() {
try {
final ContainerDetails container = docker.getContainer(containerId);
if (container == null) {
log.debug("HealthWaitChecker: Container %s not found");
return false;
}
if (container.getHealthcheck() == null) {
throw new IllegalArgumentException("Can not wait for healthstate of " + imageConfigDesc + ". No HEALTHCHECK configured.");
}
if (first) {
log.info("%s: Waiting to become healthy", imageConfigDesc);
log.debug("HealthWaitChecker: Waiting for healthcheck: '%s'", container.getHealthcheck());
first = false;
} else if (log.isDebugEnabled()) {
log.debug("HealthWaitChecker: Waiting on healthcheck '%s'", container.getHealthcheck());
}
return container.isHealthy();
} catch (DockerAccessException e) {
log.warn("Error while checking health: %s", e.getMessage());
return false;
}
}
Aggregations