From 79f7529efd43d665ba38b4e0790bc5c8b0e70b34 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 24 Apr 2025 22:45:15 -0700 Subject: [PATCH] Align credential helper logic with Docker CLI See gh-45269 --- .../configuration/DockerRegistryConfigAuthentication.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryConfigAuthentication.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryConfigAuthentication.java index f14c0725802..04aad1f956a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryConfigAuthentication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryConfigAuthentication.java @@ -133,8 +133,7 @@ class DockerRegistryConfigAuthentication implements DockerRegistryAuthentication } private CredentialHelper getCredentialHelper(String serverUrl) { - String name = this.dockerConfig.getCredHelpers().get(serverUrl); - name = (StringUtils.hasText(name)) ? name : this.dockerConfig.getCredsStore(); + String name = this.dockerConfig.getCredHelpers().getOrDefault(serverUrl, this.dockerConfig.getCredsStore()); return (name != null) ? this.credentialHelperFactory.apply(name.trim()) : null; }