Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -364,25 +364,24 @@ public void applyClusterState(ClusterChangedEvent event) {
// Skip project clients that have no credentials configured. This should not happen in serverless.
// But it is safer to skip them and is also a more consistent behaviour with the cases when
// project secrets are not present.
final var clientSettings = allClientSettings.entrySet()
final var clientSettingsWithCredentials = allClientSettings.entrySet()
.stream()
.filter(entry -> entry.getValue().getCredential() != null)
.collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue));
Copy link
Contributor

@nicktindall nicktindall Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could we change clientSettings to be clientSettingsWithCredentials (or similar) to be more descriptive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I pushed f08fbe4


if (allClientSettings.size() != clientSettings.size()) {
logger.warn(
"Project [{}] has [{}] GCS client settings, but [{}] is usable due to missing credentials for clients {}",
project.id(),
allClientSettings.size(),
clientSettings.size(),
Sets.difference(allClientSettings.keySet(), clientSettings.keySet())
);
}

// TODO: If performance is an issue, we may consider comparing just the relevant project secrets for new or updated clients
// and avoid building the clientSettings
if (newOrUpdated(project.id(), clientSettings)) {
updatedPerProjectClients.put(project.id(), new PerProjectClientsHolder(clientSettings));
if (newOrUpdated(project.id(), clientSettingsWithCredentials)) {
if (allClientSettings.size() != clientSettingsWithCredentials.size()) {
logger.warn(
"Project [{}] has [{}] GCS client settings, but [{}] is usable due to missing credentials for clients {}",
project.id(),
allClientSettings.size(),
clientSettingsWithCredentials.size(),
Sets.difference(allClientSettings.keySet(), clientSettingsWithCredentials.keySet())
);
}
updatedPerProjectClients.put(project.id(), new PerProjectClientsHolder(clientSettingsWithCredentials));
}
}

Expand Down