Skip to content

Commit 4dad56a

Browse files
committed
Restructure and polish docker code
Restructure and polish docker code to fix a package tangle and provide better separation of concerns.
1 parent 5d8d0bb commit 4dad56a

34 files changed

+750
-876
lines changed

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
import org.springframework.boot.buildpack.platform.build.BuilderMetadata.Stack;
2323
import org.springframework.boot.buildpack.platform.docker.DockerApi;
24-
import org.springframework.boot.buildpack.platform.docker.DockerException;
2524
import org.springframework.boot.buildpack.platform.docker.TotalProgressEvent;
2625
import org.springframework.boot.buildpack.platform.docker.TotalProgressPullListener;
2726
import org.springframework.boot.buildpack.platform.docker.UpdateListener;
27+
import org.springframework.boot.buildpack.platform.docker.transport.DockerEngineException;
2828
import org.springframework.boot.buildpack.platform.docker.type.Image;
2929
import org.springframework.boot.buildpack.platform.docker.type.ImageReference;
3030
import org.springframework.util.Assert;
@@ -56,7 +56,7 @@ public Builder(BuildLog log) {
5656
this.docker = docker;
5757
}
5858

59-
public void build(BuildRequest request) throws DockerException, IOException {
59+
public void build(BuildRequest request) throws DockerEngineException, IOException {
6060
Assert.notNull(request, "Request must not be null");
6161
this.log.start(request);
6262
Image builderImage = pullBuilder(request);

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
import org.apache.http.client.utils.URIBuilder;
2828

29-
import org.springframework.boot.buildpack.platform.docker.Http.Response;
29+
import org.springframework.boot.buildpack.platform.docker.transport.HttpTransport;
30+
import org.springframework.boot.buildpack.platform.docker.transport.HttpTransport.Response;
3031
import org.springframework.boot.buildpack.platform.docker.type.ContainerConfig;
3132
import org.springframework.boot.buildpack.platform.docker.type.ContainerContent;
3233
import org.springframework.boot.buildpack.platform.docker.type.ContainerReference;
@@ -53,7 +54,7 @@ public class DockerApi {
5354

5455
static final String API_VERSION = "v1.24";
5556

56-
private final Http http;
57+
private final HttpTransport http;
5758

5859
private final JsonStream jsonStream;
5960

@@ -67,23 +68,23 @@ public class DockerApi {
6768
* Create a new {@link DockerApi} instance.
6869
*/
6970
public DockerApi() {
70-
this(new HttpClientHttp());
71+
this(HttpTransport.create());
7172
}
7273

7374
/**
74-
* Create a new {@link DockerApi} instance backed by a specific {@link HttpClientHttp}
75+
* Create a new {@link DockerApi} instance backed by a specific {@link HttpTransport}
7576
* implementation.
7677
* @param http the http implementation
7778
*/
78-
DockerApi(Http http) {
79+
DockerApi(HttpTransport http) {
7980
this.http = http;
8081
this.jsonStream = new JsonStream(SharedObjectMapper.get());
8182
this.image = new ImageApi();
8283
this.container = new ContainerApi();
8384
this.volume = new VolumeApi();
8485
}
8586

86-
private Http http() {
87+
private HttpTransport http() {
8788
return this.http;
8889
}
8990

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/httpclient/DelegatingDockerHttpClientConnection.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/httpclient/LocalDockerConnectionSocketFactory.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/httpclient/LocalDockerDnsResolver.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/httpclient/LocalDockerHttpClientConnection.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/httpclient/LocalDockerHttpClientConnectionManager.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)