Search in sources :

Example 1 with DockerCertificateException

use of com.spotify.docker.client.exceptions.DockerCertificateException in project helios by spotify.

the class AgentService method createDockerClient.

private DockerClient createDockerClient(final AgentConfig config) {
    final DockerClient dockerClient;
    if (isNullOrEmpty(config.getDockerHost().dockerCertPath())) {
        dockerClient = new PollingDockerClient(config.getDockerHost().uri());
    } else {
        final Path dockerCertPath = java.nio.file.Paths.get(config.getDockerHost().dockerCertPath());
        final DockerCertificates dockerCertificates;
        try {
            dockerCertificates = new DockerCertificates(dockerCertPath);
        } catch (DockerCertificateException e) {
            throw Throwables.propagate(e);
        }
        dockerClient = new PollingDockerClient(config.getDockerHost().uri(), dockerCertificates);
    }
    return dockerClient;
}
Also used : Path(java.nio.file.Path) DockerClient(com.spotify.docker.client.DockerClient) DockerCertificateException(com.spotify.docker.client.exceptions.DockerCertificateException) DockerCertificates(com.spotify.docker.client.DockerCertificates)

Aggregations

DockerCertificates (com.spotify.docker.client.DockerCertificates)1 DockerClient (com.spotify.docker.client.DockerClient)1 DockerCertificateException (com.spotify.docker.client.exceptions.DockerCertificateException)1 Path (java.nio.file.Path)1