-
Notifications
You must be signed in to change notification settings - Fork 188
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
Mutate request instances based on existing request #2266
Conversation
@@ -453,6 +453,8 @@ | |||
|
|||
private boolean skipPersistingTooLongTaskIds = false; | |||
|
|||
private boolean allowSettingRequestInstances = false; |
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.
Maybe allowEmptyRequestInstances
might be easier to reason about for naming? This makes it sounds like we previously didn't let anyone set it but now we do, when what we are going after is the opposite
if ( | ||
existingRequest.flatMap(SingularityRequest::getInstances).isPresent() && | ||
!request.getInstances().isPresent() | ||
) { |
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.
quick thought, should this only apply to SERVICE/WORKER types? I think it is a valid operation to want to unset the instance count for an ON_DEMAND, effectively removing the instance count cap for that. With the validation as it stands we would no longer be able to do that
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 want to start allowing deploys with Singularity Requests that have an empty
instances
field and instead of failing to deploy, those requests will take on the instance count of the existing Singularity Request.The new code path behind the config value
allowSettingRequestInstances
will check checkBadRequest for both the new request has empty instances and the existing request being empty/empty instances. If the existing request isn't empty && doesn't have an emptyinstances
field and the current request has emptyinstances
, then the current request is updated to have the existing request's instance count.