From 978fc8b8685d2e7f5c17ffa50850fc34cc577552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Pardo?= Date: Thu, 27 Mar 2025 09:25:12 +0100 Subject: [PATCH] Make readOnlyBearerAuth volatile to prevent data races when executing concurrently doPullBearerAuth() and/or doPushBearerAuth() --- .../com/google/cloud/tools/jib/registry/RegistryClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java b/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java index a2d97e35bb..53e22e0176 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java @@ -237,7 +237,7 @@ static Multimap decodeTokenRepositoryGrants(String token) { // mutable private final AtomicReference authorization = new AtomicReference<>(); - private boolean readOnlyBearerAuth; + private volatile boolean readOnlyBearerAuth; private final AtomicReference initialBearerAuthenticator = new AtomicReference<>();