-
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
add PreserveCounts
to Job.Register
#8168
Conversation
preserve_counts
to Job.Register
PreserveCounts
to Job.Register
3ff5c35
to
a3803e8
Compare
a3803e8
to
f0c4984
Compare
…est for Job.Register
modified `job inspect` and `job run -output` to use anonymous struct to keep previous behavior
f0c4984
to
0284698
Compare
@@ -105,17 +106,16 @@ func (j *Jobs) EnforceRegister(job *Job, modifyIndex uint64, q *WriteOptions) (* | |||
// of the evaluation, along with any errors encountered. | |||
func (j *Jobs) RegisterOpts(job *Job, opts *RegisterOptions, q *WriteOptions) (*JobRegisterResponse, *WriteMeta, error) { | |||
// Format the request | |||
req := &RegisterJobRequest{ |
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.
JobRegisterRequest
has WriteRequest
, but we don't use it. Otherwise, has the same shape as RegisterJobRequest
req := struct { | ||
Job *api.Job | ||
}{ | ||
Job: job, | ||
} |
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.
need a class for deserializing a Job:
-embedded job spec, without all of the other job registration options.
req := struct { | ||
Job *api.Job | ||
}{ | ||
Job: job, | ||
} |
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.
need a class for deserializing a Job:
-embedded job spec, without all of the other job registration options.
@@ -943,7 +943,10 @@ func decodeBody(resp *http.Response, out interface{}) error { | |||
} | |||
} | |||
|
|||
// encodeBody is used to encode a request body | |||
// encodeBody prepares the reader to serve as the request body. |
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.
wait, are Nomad vendoring itself?
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.
i'm going to let @shoenig answer this
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.
Yes, it's more or less a mandate from Go 1.14
When the main module contains a top-level vendor directory and its go.mod file specifies go 1.14 or higher, the go command now defaults to -mod=vendor for operations that accept that flag.
Without setting -mod=mod
, the vendor
directory must be in the expected state, including vendoring of any imported submodules.
There is an open issue to improve the ergonomics around this use case. We're also working behind the scenes on the feasibility of removing the vendor
directory entirely.
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. |
expands job registration API to include the option to mutate a job, while leaving the task group counts as they are. this allow one system (e.g., CI/CD) to change job definition while another system (e.g., autoscaler) is changing job counts, without having to explicitly read-mutate-write.
in the process, this PR gets rid of a mostly-redundant struct in the
api
package,RegisterJobRequest
, which served as a serialization struct and (occasionally) a stand-in forJobRegisterRequest
(neither of which need to be exported fromapi
)resolves #8158