use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.
the class DockerSpecTests method asDockerConfigurationWithHostConfiguration.
@Test
void asDockerConfigurationWithHostConfiguration() {
DockerSpec dockerSpec = new DockerSpec();
dockerSpec.setHost("docker.example.com");
dockerSpec.setTlsVerify(true);
dockerSpec.setCertPath("/tmp/ca-cert");
DockerConfiguration dockerConfiguration = dockerSpec.asDockerConfiguration();
DockerHost host = dockerConfiguration.getHost();
assertThat(host.getAddress()).isEqualTo("docker.example.com");
assertThat(host.isSecure()).isEqualTo(true);
assertThat(host.getCertificatePath()).isEqualTo("/tmp/ca-cert");
assertThat(dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
assertThat(dockerSpec.asDockerConfiguration().getPublishRegistryAuthentication()).isNull();
}
use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.
the class DockerSpecTests method asDockerConfigurationWithHostConfigurationNoTlsVerify.
@Test
void asDockerConfigurationWithHostConfigurationNoTlsVerify() {
DockerSpec dockerSpec = new DockerSpec();
dockerSpec.setHost("docker.example.com");
DockerConfiguration dockerConfiguration = dockerSpec.asDockerConfiguration();
DockerHost host = dockerConfiguration.getHost();
assertThat(host.getAddress()).isEqualTo("docker.example.com");
assertThat(host.isSecure()).isEqualTo(false);
assertThat(host.getCertificatePath()).isNull();
assertThat(dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull();
assertThat(dockerSpec.asDockerConfiguration().getPublishRegistryAuthentication()).isNull();
}
use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.
the class RemoteHttpClientTransportTests method createIfPossibleWhenDockerHostIsNotSetReturnsNull.
@Test
void createIfPossibleWhenDockerHostIsNotSetReturnsNull() {
RemoteHttpClientTransport transport = RemoteHttpClientTransport.createIfPossible(this.environment::get, new DockerHost(null, false, null));
assertThat(transport).isNull();
}
use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.
the class RemoteHttpClientTransportTests method createIfPossibleWhenDockerHostInConfigurationIsAddressReturnsTransport.
@Test
void createIfPossibleWhenDockerHostInConfigurationIsAddressReturnsTransport() {
RemoteHttpClientTransport transport = RemoteHttpClientTransport.createIfPossible(this.environment::get, new DockerHost("tcp://192.168.1.2:2376", false, null));
assertThat(transport).isNotNull();
}
use of org.springframework.boot.buildpack.platform.docker.configuration.DockerHost in project spring-boot by spring-projects.
the class RemoteHttpClientTransportTests method createIfPossibleWhenDockerHostInConfigurationIsFileReturnsNull.
@Test
void createIfPossibleWhenDockerHostInConfigurationIsFileReturnsNull(@TempDir Path tempDir) throws IOException {
String dummySocketFilePath = Files.createTempFile(tempDir, "remote-transport", null).toAbsolutePath().toString();
RemoteHttpClientTransport transport = RemoteHttpClientTransport.createIfPossible(this.environment::get, new DockerHost(dummySocketFilePath, false, null));
assertThat(transport).isNull();
}
Aggregations