Mutate request instances based on existing request - #2266
Merged
Conversation
ssalinas
reviewed
Feb 9, 2022
|
|
||
| private boolean skipPersistingTooLongTaskIds = false; | ||
|
|
||
| private boolean allowSettingRequestInstances = false; |
Contributor
There was a problem hiding this comment.
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
ssalinas
reviewed
Feb 9, 2022
Comment on lines
+244
to
+247
| if ( | ||
| existingRequest.flatMap(SingularityRequest::getInstances).isPresent() && | ||
| !request.getInstances().isPresent() | ||
| ) { |
Contributor
There was a problem hiding this comment.
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
ssalinas
approved these changes
Mar 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to start allowing deploys with Singularity Requests that have an empty
instancesfield 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
allowSettingRequestInstanceswill 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 emptyinstancesfield and the current request has emptyinstances, then the current request is updated to have the existing request's instance count.