diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java index f953501b76..b82a6b28ac 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java @@ -104,7 +104,7 @@ public final class DockerConfiguration { public DockerConfiguration withEmptyPublishRegistryAuthentication() { return new DockerConfiguration(this.host, this.builderAuthentication, - new DockerRegistryUserAuthentication("", "", "", "")); + new DockerRegistryUserAuthentication("", "", "", ""), this.bindHostToBuilder); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/DockerSpecTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/DockerSpecTests.java index 98b16bbaad..2caffd0e12 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/DockerSpecTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/DockerSpecTests.java @@ -74,7 +74,9 @@ class DockerSpecTests { assertThat(host.getCertificatePath()).isNull(); assertThat(dockerConfiguration.isBindHostToBuilder()).isFalse(); assertThat(dockerSpec.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull(); - assertThat(dockerSpec.asDockerConfiguration().getPublishRegistryAuthentication()).isNull(); + assertThat(decoded(dockerConfiguration.getPublishRegistryAuthentication().getAuthHeader())) + .contains("\"username\" : \"\"").contains("\"password\" : \"\"").contains("\"email\" : \"\"") + .contains("\"serveraddress\" : \"\""); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DockerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DockerTests.java index 3d1eb87cfc..879af4bea4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DockerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DockerTests.java @@ -57,7 +57,9 @@ class DockerTests { assertThat(host.getCertificatePath()).isEqualTo("/tmp/ca-cert"); assertThat(dockerConfiguration.isBindHostToBuilder()).isFalse(); assertThat(docker.asDockerConfiguration().getBuilderRegistryAuthentication()).isNull(); - assertThat(docker.asDockerConfiguration().getPublishRegistryAuthentication()).isNull(); + assertThat(decoded(dockerConfiguration.getPublishRegistryAuthentication().getAuthHeader())) + .contains("\"username\" : \"\"").contains("\"password\" : \"\"").contains("\"email\" : \"\"") + .contains("\"serveraddress\" : \"\""); } @Test