diff --git a/api/jobs_test.go b/api/jobs_test.go index 150ecfc0831..d508527dbcb 100644 --- a/api/jobs_test.go +++ b/api/jobs_test.go @@ -181,6 +181,7 @@ func TestJobs_Register_NoPreserveCounts(t *testing.T) { // Query the job scale status status, _, err := jobs.ScaleStatus(*job.ID, nil) require.NoError(err) + require.Equal("default", status.Namespace) require.Equal(0, status.TaskGroups["group1"].Desired) // present => as specified require.Equal(1, status.TaskGroups["group2"].Desired) // nil => default (1) require.Equal(3, status.TaskGroups["group3"].Desired) // new => as specified diff --git a/api/scaling.go b/api/scaling.go index 9f5f03de58f..669fec8e0eb 100644 --- a/api/scaling.go +++ b/api/scaling.go @@ -76,6 +76,7 @@ type ScalingPolicyListStub struct { // JobScaleStatusResponse is used to return information about job scaling status type JobScaleStatusResponse struct { JobID string + Namespace string JobCreateIndex uint64 JobModifyIndex uint64 JobStopped bool diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index 1980dbd01da..e3114da1556 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -2037,6 +2037,7 @@ func (j *Job) ScaleStatus(args *structs.JobScaleStatusRequest, // Setup the output reply.JobScaleStatus = &structs.JobScaleStatus{ JobID: job.ID, + Namespace: job.Namespace, JobCreateIndex: job.CreateIndex, JobModifyIndex: job.ModifyIndex, JobStopped: job.Stop, diff --git a/nomad/job_endpoint_test.go b/nomad/job_endpoint_test.go index 9edd97c279c..9c8a5e8a0a1 100644 --- a/nomad/job_endpoint_test.go +++ b/nomad/job_endpoint_test.go @@ -6533,6 +6533,7 @@ func TestJobEndpoint_GetScaleStatus(t *testing.T) { expectedStatus := structs.JobScaleStatus{ JobID: jobV2.ID, + Namespace: jobV2.Namespace, JobCreateIndex: jobV2.CreateIndex, JobModifyIndex: a1.CreateIndex, JobStopped: jobV2.Stop, diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 61ad06e325b..f8ba85191c2 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1292,6 +1292,7 @@ type JobScaleStatusResponse struct { type JobScaleStatus struct { JobID string + Namespace string JobCreateIndex uint64 JobModifyIndex uint64 JobStopped bool