mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
api: add namespace to scaling status GET response object.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1292,6 +1292,7 @@ type JobScaleStatusResponse struct {
|
||||
|
||||
type JobScaleStatus struct {
|
||||
JobID string
|
||||
Namespace string
|
||||
JobCreateIndex uint64
|
||||
JobModifyIndex uint64
|
||||
JobStopped bool
|
||||
|
||||
Reference in New Issue
Block a user