-
Notifications
You must be signed in to change notification settings - Fork 2k
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
backfill region from hcl for jobUpdate and jobPlan #5664
Conversation
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.
q q about job Region being nil - but code lgtm otherwise.
We'll also need to update the |
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.
This is looking really good! - All that's left is updating the jobPlan
code then it lgtm!
@endocrimes I made the suggested changes. I am just holding off on merging to make sure all the travis tests pass. |
I forgot I also have to update the jobPlanRegion test. I am giving it parameterized test cases like jobUpdateRegion, but let me know if that is overkill |
It looks like one more TLS bug fix is necessary. Now it's failing for the right reasons (there is no path to the "regionFoo" region) https://travis-ci.org/hashicorp/nomad/jobs/544292291#L620 UPDATE: not all TLS tests require "regionFoo", some had originally used "global" |
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.
Looks ready to merge to me, but @endocrimes should give it the final thumbs up
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.
- updated region in job metadata that gets persisted to nomad datastore - fixed many unrelated unit tests that used an invalid region value (they previously passed because hcl wasn't getting picked up and the job would default to global region)
87afced
to
c467a94
Compare
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. |
Overview
This pull request is about region precedence in a job (http args > hcl job config > defaults). This feature adds a check in the jobPlan & jobUpdate http endpoints: it checks the
hcl
arg for region if none is provided in theregion
arg, and otherwise defaults to a "global" region.Implementation
Behavior
Existing behavior:
region
parameter separate from the jobhcl
parameter.hcl
argNew behavior:
hcl
arg for region if none is provided in theregion
arg, and otherwise defaults to a "global" region.This is ready for review