Skip to content

Commit

Permalink
tab and varname cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Oct 19, 2023
1 parent 753b2d7 commit e06bd41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1517,8 +1517,7 @@ type EvalOptions struct {
ForceReschedule bool
}

// nomad action is used to run a pre-defined command inside a running task.
//
// ActionExec is used to run a pre-defined command inside a running task.
// The call blocks until command terminates (or an error occurs), and returns the exit code.
func (j *Jobs) ActionExec(ctx context.Context,
alloc *Allocation, task string, tty bool, command []string,
Expand Down
2 changes: 1 addition & 1 deletion command/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Action Specific Options:
selected from the job.
-task <task-name>
Specifies the task in which the Action is defined. Required if no
Specifies the task in which the Action is defined. Required if no
allocation is provided.
-group <group-name>
Expand Down
8 changes: 4 additions & 4 deletions command/alloc_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (f *AllocFSCommand) followFile(client *api.Client, alloc *api.Allocation,

// Get Random Allocation from a known jobID. Prefer to use a running allocation,
// but use a dead allocation if no running allocations are found
func getRandomJobAlloc(client *api.Client, jobID, tasakGroupName, namespace string) (*api.AllocationListStub, error) {
func getRandomJobAlloc(client *api.Client, jobID, taskGroupName, namespace string) (*api.AllocationListStub, error) {
var runningAllocs []*api.AllocationListStub
q := &api.QueryOptions{
Namespace: namespace,
Expand All @@ -403,16 +403,16 @@ func getRandomJobAlloc(client *api.Client, jobID, tasakGroupName, namespace stri
return nil, fmt.Errorf("job %q doesn't exist or it has no allocations", jobID)
}

if tasakGroupName != "" {
if taskGroupName != "" {
var filteredAllocs []*api.AllocationListStub
for _, alloc := range allocs {
if alloc.TaskGroup == tasakGroupName {
if alloc.TaskGroup == taskGroupName {
filteredAllocs = append(filteredAllocs, alloc)
}
}
allocs = filteredAllocs
if len(allocs) == 0 {
return nil, fmt.Errorf("task group %q doesn't exist or it has no allocations", tasakGroupName)
return nil, fmt.Errorf("task group %q doesn't exist or it has no allocations", taskGroupName)
}
}

Expand Down

0 comments on commit e06bd41

Please sign in to comment.