Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.8] fix no permission to update model group index #949

Merged
merged 1 commit into from
Jun 1, 2023
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
fix no permission to update model group index (#948)
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
(cherry picked from commit da5db17)
  • Loading branch information
ylwu-amzn authored and github-actions[bot] committed Jun 1, 2023
commit 72149c41dd2b357bb35344f10d1b3e03f10d647e
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ private void updateModelGroup(

UpdateRequest updateModelGroupRequest = new UpdateRequest();
updateModelGroupRequest.index(ML_MODEL_GROUP_INDEX).id(modelGroupId).doc(source);
client
.update(
updateModelGroupRequest,
ActionListener.wrap(r -> { listener.onResponse(new MLUpdateModelGroupResponse("Updated")); }, e -> {
log.error("Failed to update Model Group", e);
throw new MLException("Failed to update Model Group", e);
})
);
try (ThreadContext.StoredContext context = client.threadPool().getThreadContext().stashContext()) {
client
.update(
updateModelGroupRequest,
ActionListener.wrap(r -> { listener.onResponse(new MLUpdateModelGroupResponse("Updated")); }, e -> {
log.error("Failed to update Model Group", e);
throw new MLException("Failed to update Model Group", e);
})
);
} catch (Exception e) {
logException("Failed to Update model group ", e, log);
listener.onFailure(e);
}
}

private void validateRequestForAccessControl(MLUpdateModelGroupInput input, User user, MLModelGroup mlModelGroup) {
Expand Down