Skip to content

Commit 05ea0cb

Browse files
authored
Fix tenant id extraction issue (#4419)
1 parent 20eb9bc commit 05ea0cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ml-algorithms/src/main/java/org/opensearch/ml/engine/memory/RemoteAgenticConversationMemory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,8 +1247,8 @@ private String extractTenantIdFromRoleArn(String serviceName, Map<String, String
12471247
// Expected format: arn:aws:iam::{account}:role/{role-name}
12481248
try {
12491249
String[] parts = roleArn.split(":");
1250-
if (parts.length >= 5 && "role".equals(parts[4])) {
1251-
String account = parts[3];
1250+
if (parts.length >= 6 && parts[5].startsWith("role/")) {
1251+
String account = parts[4];
12521252
return account + ":role";
12531253
}
12541254
} catch (Exception e) {

0 commit comments

Comments
 (0)