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

Remove Namespace field from JobScaleRequest #9296

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions command/agent/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,13 @@ func (s *HTTPServer) jobScaleAction(resp http.ResponseWriter, req *http.Request,
return nil, CodedError(400, err.Error())
}

namespace := args.Target[structs.ScalingTargetNamespace]
targetJob := args.Target[structs.ScalingTargetJob]
if targetJob != "" && targetJob != jobName {
return nil, CodedError(400, "job ID in payload did not match URL")
}

scaleReq := structs.JobScaleRequest{
JobID: jobName,
Namespace: namespace,
Target: args.Target,
Count: args.Count,
PolicyOverride: args.PolicyOverride,
Expand Down
13 changes: 6 additions & 7 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,12 @@ type JobPlanRequest struct {
// JobScaleRequest is used for the Job.Scale endpoint to scale one of the
// scaling targets in a job
type JobScaleRequest struct {
Namespace string
JobID string
Target map[string]string
Count *int64
Message string
Error bool
Meta map[string]interface{}
JobID string
Target map[string]string
Count *int64
Message string
Error bool
Meta map[string]interface{}
// PolicyOverride is set when the user is attempting to override any policies
PolicyOverride bool
WriteRequest
Expand Down