mirror of
https://github.com/kemko/nomad.git
synced 2026-01-12 13:25:42 +03:00
fix linting errors
This commit is contained in:
committed by
Mahmood Ali
parent
ee92c98d4e
commit
da3eb69a2f
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user