Search in sources :

Example 1 with DockerMachineConfiguration

use of org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration in project jkube by eclipse.

the class DockerAccessFactory method getDefaultDockerHostProviders.

/**
 * Return a list of providers which could delive connection parameters from
 * calling external commands. For this plugin this is docker-machine, but can be overridden
 * to add other config options, too.
 *
 * @return list of providers or <code>null</code> if none are applicable
 */
private List<DockerConnectionDetector.DockerHostProvider> getDefaultDockerHostProviders(DockerAccessContext dockerAccessContext, KitLogger log) {
    DockerMachineConfiguration config = dockerAccessContext.getMachine();
    if (dockerAccessContext.isSkipMachine()) {
        config = null;
    } else if (config == null) {
        Properties projectProps = dockerAccessContext.getProjectProperties();
        if (projectProps.containsKey(DockerMachineConfiguration.DOCKER_MACHINE_NAME_PROP)) {
            config = new DockerMachineConfiguration(projectProps.getProperty(DockerMachineConfiguration.DOCKER_MACHINE_NAME_PROP), projectProps.getProperty(DockerMachineConfiguration.DOCKER_MACHINE_AUTO_CREATE_PROP), projectProps.getProperty(DockerMachineConfiguration.DOCKER_MACHINE_REGENERATE_CERTS_AFTER_START_PROP));
        }
    }
    List<DockerConnectionDetector.DockerHostProvider> ret = new ArrayList<>();
    ret.add(new DockerMachine(log, config));
    return ret;
}
Also used : DockerMachine(org.eclipse.jkube.kit.build.service.docker.access.DockerMachine) DockerMachineConfiguration(org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration) ArrayList(java.util.ArrayList) Properties(java.util.Properties)

Aggregations

ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 DockerMachine (org.eclipse.jkube.kit.build.service.docker.access.DockerMachine)1 DockerMachineConfiguration (org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration)1