Search in sources :

Example 31 with DockerClient

use of com.spotify.docker.client.DockerClient in project opennms by OpenNMS.

the class SyslogKafkaElasticsearchBufferingIT method getServiceAddress.

protected static InetSocketAddress getServiceAddress(AbstractTestEnvironment env, ContainerAlias alias, int port, String protocol) {
    try {
        // Fetch an up-to-date ContainerInfo for the ELASTICSEARCH_5 container
        final DockerClient docker = env.getDockerClient();
        final String id = env.getContainerInfo(alias).id();
        ContainerInfo info = docker.inspectContainer(id);
        return env.getServiceAddress(info, port, protocol);
    } catch (DockerException | InterruptedException e) {
        LOG.error("Unexpected exception trying to fetch Elassticsearch port", e);
        return null;
    }
}
Also used : DockerException(com.spotify.docker.client.exceptions.DockerException) DockerClient(com.spotify.docker.client.DockerClient) ContainerInfo(com.spotify.docker.client.messages.ContainerInfo)

Aggregations

DockerClient (com.spotify.docker.client.DockerClient)31 Test (org.junit.Test)21 JobId (com.spotify.helios.common.descriptors.JobId)19 TaskStatus (com.spotify.helios.common.descriptors.TaskStatus)18 LogStream (com.spotify.docker.client.LogStream)11 Matchers.containsString (org.hamcrest.Matchers.containsString)11 HeliosClient (com.spotify.helios.client.HeliosClient)10 Deployment (com.spotify.helios.common.descriptors.Deployment)8 DockerException (com.spotify.docker.client.exceptions.DockerException)7 Job (com.spotify.helios.common.descriptors.Job)7 CreateJobResponse (com.spotify.helios.common.protocol.CreateJobResponse)6 JobDeployResponse (com.spotify.helios.common.protocol.JobDeployResponse)6 Container (com.spotify.docker.client.messages.Container)4 ContainerInfo (com.spotify.docker.client.messages.ContainerInfo)4 HostConfig (com.spotify.docker.client.messages.HostConfig)4 HostStatus (com.spotify.helios.common.descriptors.HostStatus)4 DockerRequestException (com.spotify.docker.client.exceptions.DockerRequestException)3 ContainerConfig (com.spotify.docker.client.messages.ContainerConfig)3 ContainerCreation (com.spotify.docker.client.messages.ContainerCreation)3 AgentMain (com.spotify.helios.agent.AgentMain)3