Samrat002 commented on code in PR #27788:
URL: https://github.com/apache/flink/pull/27788#discussion_r3121284204
##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3FileSystemFactory.java:
##########
@@ -359,35 +413,51 @@ public FileSystem create(URI fsUri) throws IOException {
.socketTimeout(config.get(SOCKET_TIMEOUT))
.connectionMaxIdleTime(config.get(CONNECTION_MAX_IDLE_TIME))
.clientCloseTimeout(config.get(CLIENT_CLOSE_TIMEOUT))
- .assumeRoleArn(config.get(ASSUME_ROLE_ARN))
-
.assumeRoleExternalId(config.get(ASSUME_ROLE_EXTERNAL_ID))
-
.assumeRoleSessionName(config.get(ASSUME_ROLE_SESSION_NAME))
- .assumeRoleSessionDurationSeconds(
-
config.get(ASSUME_ROLE_SESSION_DURATION_SECONDS))
+ .assumeRoleArn(assumeRoleArn)
+ .assumeRoleExternalId(assumeRoleExternalId)
+ .assumeRoleSessionName(assumeRoleSessionName)
+
.assumeRoleSessionDurationSeconds(assumeRoleSessionDuration)
.maxRetries(config.get(MAX_RETRIES))
-
.credentialsProviderClasses(config.get(AWS_CREDENTIALS_PROVIDER))
+ .credentialsProviderClasses(credentialsProviderClasses)
.encryptionConfig(encryptionConfig)
.build();
- NativeS3BulkCopyHelper bulkCopyHelper = null;
Review Comment:
This is the core of how bucket-level overrides work. The flow is:
1. Read global value into local: String `assumeRoleArn =
config.get(ASSUME_ROLE_ARN)`
2. Apply bucket override: `assumeRoleArn =
firstNonNull(overrides.getAssumeRoleArn(), assumeRoleArn)`
3. Pass the (possibly overridden) local to the builder:
`.assumeRoleArn(assumeRoleArn)`
If we kept `config.get(ASSUME_ROLE_ARN)` directly in the builder call,
bucket-level overrides would be silently ignored. The builder would always
receive the global value. The same applies to all other fields changed here
(assumeRoleExternalId, assumeRoleSessionName, assumeRoleSessionDuration,
credentialsProviderClasses).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]