Changes in TaskQuery structs used in the proyect
* Now that TaskQuery receive optional values, pointers instead of values must be passed to the structt
This commit is contained in:
parent
eb0de4e7f4
commit
1d22cb620c
3 changed files with 13 additions and 17 deletions
|
@ -553,9 +553,9 @@ func main() {
|
||||||
case "taskStatus":
|
case "taskStatus":
|
||||||
fmt.Println("Getting task status")
|
fmt.Println("Getting task status")
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{
|
||||||
Role: job.JobKey().Role,
|
Role: &job.JobKey().Role,
|
||||||
Environment: job.JobKey().Environment,
|
Environment: &job.JobKey().Environment,
|
||||||
JobName: job.JobKey().Name,
|
JobName: &job.JobKey().Name,
|
||||||
}
|
}
|
||||||
tasks, err := r.GetTaskStatus(taskQ)
|
tasks, err := r.GetTaskStatus(taskQ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -567,9 +567,9 @@ func main() {
|
||||||
case "tasksWithoutConfig":
|
case "tasksWithoutConfig":
|
||||||
fmt.Println("Getting task status")
|
fmt.Println("Getting task status")
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{
|
||||||
Role: job.JobKey().Role,
|
Role: &job.JobKey().Role,
|
||||||
Environment: job.JobKey().Environment,
|
Environment: &job.JobKey().Environment,
|
||||||
JobName: job.JobKey().Name,
|
JobName: &job.JobKey().Name,
|
||||||
}
|
}
|
||||||
tasks, err := r.GetTasksWithoutConfigs(taskQ)
|
tasks, err := r.GetTasksWithoutConfigs(taskQ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
12
realis.go
12
realis.go
|
@ -497,9 +497,9 @@ func (r *realisClient) Close() {
|
||||||
// Uses predefined set of states to retrieve a set of active jobs in Apache Aurora.
|
// Uses predefined set of states to retrieve a set of active jobs in Apache Aurora.
|
||||||
func (r *realisClient) GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error) {
|
func (r *realisClient) GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error) {
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{
|
||||||
Role: key.Role,
|
Role: &key.Role,
|
||||||
Environment: key.Environment,
|
Environment: &key.Environment,
|
||||||
JobName: key.Name,
|
JobName: &key.Name,
|
||||||
Statuses: states,
|
Statuses: states,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -880,9 +880,9 @@ func (r *realisClient) FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.Task
|
||||||
|
|
||||||
ids[instKey.InstanceId] = true
|
ids[instKey.InstanceId] = true
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{
|
||||||
Role: instKey.JobKey.Role,
|
Role: &instKey.JobKey.Role,
|
||||||
Environment: instKey.JobKey.Environment,
|
Environment: &instKey.JobKey.Environment,
|
||||||
JobName: instKey.JobKey.Name,
|
JobName: &instKey.JobKey.Name,
|
||||||
InstanceIds: ids,
|
InstanceIds: ids,
|
||||||
Statuses: aurora.ACTIVE_STATES,
|
Statuses: aurora.ACTIVE_STATES,
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,11 +75,7 @@ func TestNonExistentEndpoint(t *testing.T) {
|
||||||
)
|
)
|
||||||
defer r.Close()
|
defer r.Close()
|
||||||
|
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{}
|
||||||
Role: "no",
|
|
||||||
Environment: "task",
|
|
||||||
JobName: "here",
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = r.GetTasksWithoutConfigs(taskQ)
|
_, err = r.GetTasksWithoutConfigs(taskQ)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue