Skip to content
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

mrd: remove redundant validation in HTTP endpoint #8685

Merged
merged 1 commit into from
Aug 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions command/agent/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ func (s *HTTPServer) jobPlan(resp http.ResponseWriter, req *http.Request,
return nil, CodedError(400, "Job ID does not match")
}

if args.Job.Multiregion != nil && args.Job.Region != nil {
region := *args.Job.Region
if !(region == "global" || region == "") {
return nil, CodedError(400, "Job can't have both multiregion and region blocks")
}
}

sJob, writeReq := s.apiJobAndRequestToStructs(args.Job, req, args.WriteRequest)
planReq := structs.JobPlanRequest{
Job: sJob,
Expand Down Expand Up @@ -384,12 +377,6 @@ func (s *HTTPServer) jobUpdate(resp http.ResponseWriter, req *http.Request,
if jobName != "" && *args.Job.ID != jobName {
return nil, CodedError(400, "Job ID does not match name")
}
if args.Job.Multiregion != nil && args.Job.Region != nil {
region := *args.Job.Region
if !(region == "global" || region == "") {
return nil, CodedError(400, "Job can't have both multiregion and region blocks")
}
}

// GH-8481. Jobs of type system can only have a count of 1 and therefore do
// not support scaling. Even though this returns an error on the first
Expand Down