Skip to content

Commit

Permalink
style: typos in fucntion names and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanadelacuesta committed Mar 11, 2024
1 parent 8000e15 commit 7a2740a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11438,11 +11438,11 @@ func (a *Allocation) NeedsToReconnect() bool {
return disconnected
}

// LeaderOrMainTaskInInGroup will return the leader task in the allocation
// LeaderOrMainTaskInGroup will return the leader task in the allocation
// if there is one, otherwise it will return the first task that run as main.
// If the task group is no longer present or there are no tasks in it, it
// will return nil.
func (a *Allocation) LeaderOrMainTaskInInGroup(tg *TaskGroup) *Task {
func (a *Allocation) LeaderOrMainTaskInGroup(tg *TaskGroup) *Task {
if tg == nil {
return nil
}
Expand Down Expand Up @@ -11476,7 +11476,7 @@ func (a *Allocation) LeaderOrMainTaskInInGroup(tg *TaskGroup) *Task {
return task
}

// LatestStartOfTask returns the time of the last start event for the given task
// LastStartOfTask returns the time of the last start event for the given task
// using the allocations TaskStates. If the task has not started, the zero time
// will be returned.
func (a *Allocation) LastStartOfTask(taskName string) time.Time {
Expand Down
8 changes: 4 additions & 4 deletions nomad/structs/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5915,14 +5915,14 @@ func TestAllocation_RescheduleTimeOnDisconnect(t *testing.T) {
taskGroup: "web",
disconnectGroup: nil,
expected: true,
expectedTime: testNow.Add(RestartPolicyMinInterval), // RestartPolicyMinInterval is de default value
expectedTime: testNow.Add(RestartPolicyMinInterval), // RestartPolicyMinInterval is the default value
},
{
name: "empty_disconnect_group",
taskGroup: "web",
disconnectGroup: &DisconnectStrategy{},
expected: true,
expectedTime: testNow.Add(RestartPolicyMinInterval), // RestartPolicyMinInterval is de default value
expectedTime: testNow.Add(RestartPolicyMinInterval), // RestartPolicyMinInterval is the default value
},
{
name: "replace_enabled",
Expand Down Expand Up @@ -5959,7 +5959,7 @@ func TestAllocation_RescheduleTimeOnDisconnect(t *testing.T) {
}
}

func TestAllocation_LeaderOrMainTaskInInGroup(t *testing.T) {
func TestAllocation_LeaderOrMainTaskInGroup(t *testing.T) {
ci.Parallel(t)

taskGroupNoTasks := &TaskGroup{
Expand Down Expand Up @@ -6080,7 +6080,7 @@ func TestAllocation_LeaderOrMainTaskInInGroup(t *testing.T) {
ta := testAlloc.Copy()
ta.TaskGroup = tc.taskGroup.Name

got := ta.LeaderOrMainTaskInInGroup(tc.taskGroup)
got := ta.LeaderOrMainTaskInGroup(tc.taskGroup)
must.Eq(t, tc.expected, got)
}
}
Expand Down
2 changes: 1 addition & 1 deletion scheduler/reconnecting_picker/reconnecting_picker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (rp *ReconnectingPicker) pickReplacement(_ *structs.Allocation, replacement
func (rp *ReconnectingPicker) pickLongestRunning(original *structs.Allocation, replacement *structs.Allocation) *structs.Allocation {
tg := original.Job.LookupTaskGroup(original.TaskGroup)

lt := original.LeaderOrMainTaskInInGroup(tg)
lt := original.LeaderOrMainTaskInGroup(tg)

if lt == nil {
return replacement
Expand Down

0 comments on commit 7a2740a

Please sign in to comment.