Skip to content

Commit 1371d2a

Browse files
committed
Dedup
1 parent 7c3f82e commit 1371d2a

File tree

1 file changed

+11
-21
lines changed
  • modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3

1 file changed

+11
-21
lines changed

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -291,27 +291,17 @@ Region getClientRegion(S3ClientSettings clientSettings) {
291291
return defaultRegion;
292292
}
293293

294-
if (hasEndpoint) {
295-
LOGGER.warn(
296-
"""
297-
found S3 client with no configured region and {}, falling back to [{}]; \
298-
to suppress this warning, configure the [{}] setting on this node""",
299-
endpointDescription,
300-
Region.US_EAST_1,
301-
S3ClientSettings.REGION.getConcreteSettingForNamespace("CLIENT_NAME").getKey()
302-
);
303-
return Region.US_EAST_1;
304-
} else {
305-
LOGGER.warn(
306-
"""
307-
found S3 client with no configured region and {}, falling back to [{}] and enabling cross-region access; \
308-
to suppress this warning, configure the [{}] setting on this node""",
309-
endpointDescription,
310-
Region.US_EAST_1,
311-
S3ClientSettings.REGION.getConcreteSettingForNamespace("CLIENT_NAME").getKey()
312-
);
313-
return null;
314-
}
294+
LOGGER.warn(
295+
"""
296+
found S3 client with no configured region and {}, falling back to [{}]{}; \
297+
to suppress this warning, configure the [{}] setting on this node""",
298+
endpointDescription,
299+
Region.US_EAST_1,
300+
hasEndpoint ? "" : " and enabling cross-region access",
301+
S3ClientSettings.REGION.getConcreteSettingForNamespace("CLIENT_NAME").getKey()
302+
);
303+
304+
return hasEndpoint ? Region.US_EAST_1 : null;
315305
}
316306

317307
@Nullable // in production, but exposed for tests to override

0 commit comments

Comments
 (0)