Commit da3eb69a authored by Jasmine Dahilig's avatar Jasmine Dahilig Committed by Mahmood Ali
Browse files

fix linting errors

parent ee92c98d
Showing with 11 additions and 11 deletions
+11 -11
......@@ -78,7 +78,7 @@ func (c *taskHookCoordinator) taskStateUpdated(states map[string]*structs.TaskSt
return
}
for task, _ := range c.prestartTasksUntilRunning {
for task := range c.prestartTasksUntilRunning {
st := states[task]
if st == nil || st.StartedAt.IsZero() {
continue
......@@ -87,7 +87,7 @@ func (c *taskHookCoordinator) taskStateUpdated(states map[string]*structs.TaskSt
delete(c.prestartTasksUntilRunning, task)
}
for task, _ := range c.prestartTasksUntilCompleted {
for task := range c.prestartTasksUntilCompleted {
st := states[task]
if st == nil || !st.Successful() {
continue
......
......@@ -69,17 +69,17 @@ func TestTaskHookCoordinator_MainRunsAfterPrestart(t *testing.T) {
require.Truef(t, isChannelClosed(sideCh), "%s channel was open, should be closed", sideTaskName)
states := map[string]*structs.TaskState{
mainTaskName: &structs.TaskState{
mainTaskName: {
State: structs.TaskStatePending,
Failed: false,
},
initTaskName: &structs.TaskState{
initTaskName: {
State: structs.TaskStateDead,
Failed: false,
StartedAt: time.Now(),
FinishedAt: time.Now(),
},
sideTaskName: &structs.TaskState{
sideTaskName: {
State: structs.TaskStateRunning,
Failed: false,
StartedAt: time.Now(),
......@@ -116,17 +116,17 @@ func TestTaskHookCoordinator_MainRunsAfterManyInitTasks(t *testing.T) {
require.Truef(t, isChannelClosed(init2Ch), "%s channel was open, should be closed", tasks[2].Name)
states := map[string]*structs.TaskState{
tasks[0].Name: &structs.TaskState{
tasks[0].Name: {
State: structs.TaskStatePending,
Failed: false,
},
tasks[1].Name: &structs.TaskState{
tasks[1].Name: {
State: structs.TaskStateDead,
Failed: false,
StartedAt: time.Now(),
FinishedAt: time.Now(),
},
tasks[2].Name: &structs.TaskState{
tasks[2].Name: {
State: structs.TaskStateDead,
Failed: false,
StartedAt: time.Now(),
......
......@@ -272,7 +272,7 @@ func Job() *structs.Job {
func LifecycleSideTask(resources structs.Resources, i int) *structs.Task {
return &structs.Task{
Name: fmt.Sprintf("side-%s", i),
Name: fmt.Sprintf("side-%d", i),
Driver: "exec",
Config: map[string]interface{}{
"command": "/bin/date",
......@@ -288,7 +288,7 @@ func LifecycleSideTask(resources structs.Resources, i int) *structs.Task {
func LifecycleInitTask(resources structs.Resources, i int) *structs.Task {
return &structs.Task{
Name: fmt.Sprintf("init-%s", i),
Name: fmt.Sprintf("init-%d", i),
Driver: "exec",
Config: map[string]interface{}{
"command": "/bin/date",
......@@ -304,7 +304,7 @@ func LifecycleInitTask(resources structs.Resources, i int) *structs.Task {
func LifecycleMainTask(resources structs.Resources, i int) *structs.Task {
return &structs.Task{
Name: fmt.Sprintf("main-%s", i),
Name: fmt.Sprintf("main-%d", i),
Driver: "exec",
Config: map[string]interface{}{
"command": "/bin/date",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment