-
Notifications
You must be signed in to change notification settings - Fork 138
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
do not allow non super admin users to undeploy hidden models #1981
Conversation
Signed-off-by: Bhavana Ramaram <rbhavna@amazon.com>
} else { | ||
listener.onFailure(new IllegalArgumentException("No permission to undeploy model " + modelId)); | ||
} | ||
}, listener::onFailure)); | ||
return; | ||
} else { | ||
// Only allow user undeploy one model if model access control enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more comments explain why?
throw new IllegalArgumentException("only support undeploy one model"); | ||
} | ||
|
||
if (modelIds.length == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when there is only one model, why there is no need to check whether it's hidden model or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do check it. All validations are done here when there is only one model
Signed-off-by: Bhavana Ramaram <rbhavna@amazon.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 2.x #1981 +/- ##
============================================
- Coverage 82.80% 82.58% -0.23%
+ Complexity 5513 5502 -11
============================================
Files 533 533
Lines 22134 22167 +33
Branches 2253 2256 +3
============================================
- Hits 18329 18306 -23
- Misses 2881 2934 +53
- Partials 924 927 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* do not allow non super admin users to undeploy hidden models Signed-off-by: Bhavana Ramaram <rbhavna@amazon.com> (cherry picked from commit 4de949c)
…rch-project#1981) (opensearch-project#1983) * do not allow non super admin users to undeploy hidden models Signed-off-by: Bhavana Ramaram <rbhavna@amazon.com> (cherry picked from commit 4de949c) Co-authored-by: Bhavana Ramaram <rbhavna@amazon.com>
Description
do not allow non super admin users to undeploy hidden models
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.