-
Notifications
You must be signed in to change notification settings - Fork 186
Add extension to agent decom #2207
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
Conversation
| private static final String AGENTS_DECOMISSION_FORMAT = | ||
| AGENTS_FORMAT + "/agent/%s/decommission"; | ||
| private static final String EXTEND_AGENTS_DECOMISSION_FORMAT = | ||
| AGENTS_FORMAT + "/agent/%s/decommission/extend"; |
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.
Probably want to change language from extend to update since it's a more generic operation.
| String agentId, | ||
| SingularityMachineChangeRequest changeRequest | ||
| ) { | ||
| authorizationHelper.checkAdminAuthorization(user); |
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.
Someone could effectively reactivate or permanently decom an agent with this update, so we should also check validator.checkActionEnabled(action) for actions SingularityAction.ACTIVATE_AGENT and SingularityAction.DECOMMISSION_AGENT just to be safe here.
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.
Ok, I can do that. The validator is private to AbstractMachineResource, do you think I should change it to protected or move this function to AbstractMachineResource?
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.
I'd follow whatever pattern the base decom method uses (I think move into AbstractMachineResource)
|
🚢 |
We have been experiencing decommissioned agents coming back online too early. This endpoint will allow us to extend the decommission time if the agent isn't ready.