Resolve merge conflicts
This commit is contained in:
@@ -16,7 +16,7 @@ type apiQuerier interface {
|
||||
// JobScale returns the scale of the passed job.
|
||||
JobScale(jobId string) (jobScale int, err error)
|
||||
|
||||
// SetJobScaling sets the scaling count of the passed job to Nomad.
|
||||
// SetJobScale sets the scaling count of the passed job to Nomad.
|
||||
SetJobScale(jobId string, count int, reason string) (err error)
|
||||
|
||||
// DeleteRunner deletes the runner with the given Id.
|
||||
@@ -39,26 +39,6 @@ func (nc *nomadApiClient) init(nomadURL *url.URL) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func (nc *nomadApiClient) LoadJobList() (list []*nomadApi.JobListStub, err error) {
|
||||
list, _, err = nc.client.Jobs().List(nil)
|
||||
return
|
||||
}
|
||||
|
||||
func (nc *nomadApiClient) JobScale(jobId string) (jobScale int, err error) {
|
||||
status, _, err := nc.client.Jobs().ScaleStatus(jobId, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// ToDo: Consider counting also the placed and desired allocations
|
||||
jobScale = status.TaskGroups[jobId].Running
|
||||
return
|
||||
}
|
||||
|
||||
func (nc *nomadApiClient) SetJobScale(jobId string, count int, reason string) (err error) {
|
||||
_, _, err = nc.client.Jobs().Scale(jobId, jobId, &count, reason, false, nil, nil)
|
||||
return
|
||||
}
|
||||
|
||||
func (nc *nomadApiClient) DeleteRunner(runnerId string) (err error) {
|
||||
allocation, _, err := nc.client.Allocations().Info(runnerId, nil)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user