Skip to content

Commit fc86c38

Browse files
committed
Fix DocerApiTests and import route
Signed-off-by: hojooo <ghwn5833@gmail.com>
1 parent 3bd8188 commit fc86c38

File tree

2 files changed

+8
-4
lines changed
  • buildpack/spring-boot-buildpack-platform/src

2 files changed

+8
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public void exportImageLayers(ImageReference reference, IOBiConsumer<String, Tar
367367
ImageReference pinned = reference;
368368
String digest = Builder.this.docker.image().resolveManifestDigest(reference,
369369
this.imageFetcher.defaultPlatform);
370-
if (org.springframework.util.StringUtils.hasText(digest)) {
370+
if (StringUtils.hasText(digest)) {
371371
pinned = pinned.withDigest(digest);
372372
}
373373
if (!pinned.equals(reference)) {

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@ class DockerApiTests {
9191

9292
private static final String PLATFORM_API_URL = "/v" + DockerApi.PLATFORM_API_VERSION;
9393

94+
private static final String INSPECT_PLATFORM_API_URL = "/v" + DockerApi.INSPECT_PLATFORM_API_VERSION;
95+
9496
public static final String PING_URL = "/_ping";
9597

9698
private static final String IMAGES_URL = API_URL + "/images";
9799

98100
private static final String PLATFORM_IMAGES_URL = PLATFORM_API_URL + "/images";
99101

102+
private static final String INSPECT_PLATFORM_IMAGES_URL = INSPECT_PLATFORM_API_URL + "/images";
103+
100104
private static final String CONTAINERS_URL = API_URL + "/containers";
101105

102106
private static final String PLATFORM_CONTAINERS_URL = PLATFORM_API_URL + "/containers";
@@ -239,10 +243,10 @@ void pullWithPlatformPullsImageAndProducesEvents() throws Exception {
239243
ImagePlatform platform = ImagePlatform.of("linux/arm64/v1");
240244
URI createUri = new URI(PLATFORM_IMAGES_URL
241245
+ "/create?fromImage=gcr.io%2Fpaketo-buildpacks%2Fbuilder%3Abase&platform=linux%2Farm64%2Fv1");
242-
URI imageUri = new URI(PLATFORM_IMAGES_URL
243-
+ "/gcr.io/paketo-buildpacks/builder@sha256:4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30/json");
246+
URI imageUri = new URI(INSPECT_PLATFORM_IMAGES_URL
247+
+ "/gcr.io/paketo-buildpacks/builder:base/json?platform=%7B%22os%22%3A%22linux%22%2C%22architecture%22%3A%22arm64%22%2C%22variant%22%3A%22v1%22%7D");
244248
given(http().head(eq(new URI(PING_URL))))
245-
.willReturn(responseWithHeaders(new BasicHeader(DockerApi.API_VERSION_HEADER_NAME, "1.41")));
249+
.willReturn(responseWithHeaders(new BasicHeader(DockerApi.API_VERSION_HEADER_NAME, "1.49")));
246250
given(http().post(eq(createUri), isNull())).willReturn(responseOf("pull-stream.json"));
247251
given(http().get(imageUri)).willReturn(responseOf("type/image.json"));
248252
Image image = this.api.pull(reference, platform, this.pullListener);

0 commit comments

Comments
 (0)