Skip to content

Conversation

@rosalind210
Copy link
Contributor

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.

@rosalind210 rosalind210 marked this pull request as draft May 26, 2021 17:06
@rosalind210 rosalind210 marked this pull request as ready for review May 27, 2021 20:43
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";
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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)

@pschoenfelder
Copy link
Contributor

🚢

@rosalind210 rosalind210 merged commit bd47986 into master Jun 2, 2021
@rosalind210 rosalind210 deleted the agent_decom_delay branch June 2, 2021 15:12
@ssalinas ssalinas added this to the 1.5.0 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants