@@ -364,25 +364,24 @@ public void applyClusterState(ClusterChangedEvent event) {
364
364
// Skip project clients that have no credentials configured. This should not happen in serverless.
365
365
// But it is safer to skip them and is also a more consistent behaviour with the cases when
366
366
// project secrets are not present.
367
- final var clientSettings = allClientSettings .entrySet ()
367
+ final var clientSettingsWithCredentials = allClientSettings .entrySet ()
368
368
.stream ()
369
369
.filter (entry -> entry .getValue ().getCredential () != null )
370
370
.collect (Collectors .toUnmodifiableMap (Map .Entry ::getKey , Map .Entry ::getValue ));
371
371
372
- if (allClientSettings .size () != clientSettings .size ()) {
373
- logger .warn (
374
- "Project [{}] has [{}] GCS client settings, but [{}] is usable due to missing credentials for clients {}" ,
375
- project .id (),
376
- allClientSettings .size (),
377
- clientSettings .size (),
378
- Sets .difference (allClientSettings .keySet (), clientSettings .keySet ())
379
- );
380
- }
381
-
382
372
// TODO: If performance is an issue, we may consider comparing just the relevant project secrets for new or updated clients
383
373
// and avoid building the clientSettings
384
- if (newOrUpdated (project .id (), clientSettings )) {
385
- updatedPerProjectClients .put (project .id (), new PerProjectClientsHolder (clientSettings ));
374
+ if (newOrUpdated (project .id (), clientSettingsWithCredentials )) {
375
+ if (allClientSettings .size () != clientSettingsWithCredentials .size ()) {
376
+ logger .warn (
377
+ "Project [{}] has [{}] GCS client settings, but [{}] is usable due to missing credentials for clients {}" ,
378
+ project .id (),
379
+ allClientSettings .size (),
380
+ clientSettingsWithCredentials .size (),
381
+ Sets .difference (allClientSettings .keySet (), clientSettingsWithCredentials .keySet ())
382
+ );
383
+ }
384
+ updatedPerProjectClients .put (project .id (), new PerProjectClientsHolder (clientSettingsWithCredentials ));
386
385
}
387
386
}
388
387
0 commit comments