Add preserve-resources flag#26841
Conversation
48101f4 to
5e04bc2
Compare
aimeeu
left a comment
There was a problem hiding this comment.
minor nit - thanks for updating the docs!
| - `-preserve-counts`: If set, the existing task group counts will be preserved | ||
| when updating a job. | ||
|
|
||
| - `-preserve-resources`: If set, the existing task resources will be preserved |
There was a problem hiding this comment.
| - `-preserve-resources`: If set, the existing task resources will be preserved | |
| - `-preserve-resources`: If set, the existing task resources are preserved |
change to present tense, and also to match other entries
1e87f8f to
8a886da
Compare
8a886da to
da6bfe4
Compare
aimeeu
left a comment
There was a problem hiding this comment.
doc content look great - thank you!
tgross
left a comment
There was a problem hiding this comment.
LGTM!
I think if we could do it over again we'd probably figure out a better way to split up the declarative job spec from the ephemeral job state, and stick the scaling counts in the job state. And that's informing the awkwardness of having to wrap the upsertJobImpl this way where we're pushing the request down to the state store. We could rewrite every caller of UpsertJob to take a request (similar to other methods) but that's hundreds and hundreds of new lines of test code where we're making up a request to contain the job and don't care about these flags. Not worth the added test complexity everywhere.
![]()
|
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Description
Adds a
--preserve-resourcesflag when running a job to preserve the task resources when updating an existing job. In situations where the resources of a task were updated separately, like via nomad-autoscaler, the job can still be deployed and choose to keep those configurations.Testing & Reproduction steps
Added unit tests, and tested flag manually by running the DAS autoscaler
Links
internal ref: https://hashicorp.atlassian.net/browse/NMD-870
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.