commit
f07cd17590
|
@ -206,7 +206,7 @@ func formatJobDiff(job *api.JobDiff, verbose bool) string {
|
|||
out := fmt.Sprintf("%s[bold]Job: %q\n", marker, job.ID)
|
||||
|
||||
// Determine the longest markers and fields so that the output can be
|
||||
// properly alligned.
|
||||
// properly aligned.
|
||||
longestField, longestMarker := getLongestPrefixes(job.Fields, job.Objects)
|
||||
for _, tg := range job.TaskGroups {
|
||||
if _, l := getDiffString(tg.Type); l > longestMarker {
|
||||
|
@ -275,7 +275,7 @@ func formatTaskGroupDiff(tg *api.TaskGroupDiff, tgPrefix int, verbose bool) stri
|
|||
}
|
||||
|
||||
// Determine the longest field and markers so the output is properly
|
||||
// alligned
|
||||
// aligned
|
||||
longestField, longestMarker := getLongestPrefixes(tg.Fields, tg.Objects)
|
||||
for _, task := range tg.Tasks {
|
||||
if _, l := getDiffString(task.Type); l > longestMarker {
|
||||
|
@ -307,7 +307,7 @@ func formatTaskGroupDiff(tg *api.TaskGroupDiff, tgPrefix int, verbose bool) stri
|
|||
// formatTaskDiff produces an annotated diff of a task. If the verbose field is
|
||||
// set, the tasks fields and objects are expanded even if the full object is an
|
||||
// addition or removal. startPrefix is the number of spaces to prefix the output of
|
||||
// the task and taskPrefix is the number of spaces to put betwen the marker and
|
||||
// the task and taskPrefix is the number of spaces to put between the marker and
|
||||
// task name output.
|
||||
func formatTaskDiff(task *api.TaskDiff, startPrefix, taskPrefix int, verbose bool) string {
|
||||
marker, _ := getDiffString(task.Type)
|
||||
|
@ -334,7 +334,7 @@ func formatTaskDiff(task *api.TaskDiff, startPrefix, taskPrefix int, verbose boo
|
|||
|
||||
// formatObjectDiff produces an annotated diff of an object. startPrefix is the
|
||||
// number of spaces to prefix the output of the object and keyPrefix is the number
|
||||
// of spaces to put betwen the marker and object name output.
|
||||
// of spaces to put between the marker and object name output.
|
||||
func formatObjectDiff(diff *api.ObjectDiff, startPrefix, keyPrefix int) string {
|
||||
start := strings.Repeat(" ", startPrefix)
|
||||
marker, _ := getDiffString(diff.Type)
|
||||
|
@ -350,7 +350,7 @@ func formatObjectDiff(diff *api.ObjectDiff, startPrefix, keyPrefix int) string {
|
|||
|
||||
// formatFieldDiff produces an annotated diff of a field. startPrefix is the
|
||||
// number of spaces to prefix the output of the field, keyPrefix is the number
|
||||
// of spaces to put betwen the marker and field name output and valuePrefix is
|
||||
// of spaces to put between the marker and field name output and valuePrefix is
|
||||
// the number of spaces to put infront of the value for aligning values.
|
||||
func formatFieldDiff(diff *api.FieldDiff, startPrefix, keyPrefix, valuePrefix int) string {
|
||||
marker, _ := getDiffString(diff.Type)
|
||||
|
|
|
@ -128,7 +128,7 @@ func (b *BlockedEvals) Block(eval *structs.Evaluation) {
|
|||
|
||||
// Reblock tracks the passed evaluation and enqueues it into the eval broker when
|
||||
// a suitable node calls unblock. Reblock should be used over Block when the
|
||||
// blocking is occuring by an outstanding evaluation. The token is the
|
||||
// blocking is occurring by an outstanding evaluation. The token is the
|
||||
// evaluation's token.
|
||||
func (b *BlockedEvals) Reblock(eval *structs.Evaluation, token string) {
|
||||
b.processBlock(eval, token)
|
||||
|
@ -245,7 +245,7 @@ func (b *BlockedEvals) Unblock(computedClass string, index uint64) {
|
|||
|
||||
// Store the index in which the unblock happened. We use this on subsequent
|
||||
// block calls in case the evaluation was in the scheduler when a trigger
|
||||
// occured.
|
||||
// occurred.
|
||||
b.unblockIndexes[computedClass] = index
|
||||
b.l.Unlock()
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ func TestBlockedEvals_Block_ImmediateUnblock_Escaped(t *testing.T) {
|
|||
}
|
||||
|
||||
// Test the block case in which the eval should be immediately unblocked since
|
||||
// there is an unblock on an unseen class that occured while it was in the
|
||||
// there is an unblock on an unseen class that occurred while it was in the
|
||||
// scheduler
|
||||
func TestBlockedEvals_Block_ImmediateUnblock_UnseenClass_After(t *testing.T) {
|
||||
blocked, broker := testBlockedEvals(t)
|
||||
|
@ -327,7 +327,7 @@ func TestBlockedEvals_Block_ImmediateUnblock_UnseenClass_After(t *testing.T) {
|
|||
}
|
||||
|
||||
// Test the block case in which the eval should not immediately unblock since
|
||||
// there is an unblock on an unseen class that occured before it was in the
|
||||
// there is an unblock on an unseen class that occurred before it was in the
|
||||
// scheduler
|
||||
func TestBlockedEvals_Block_ImmediateUnblock_UnseenClass_Before(t *testing.T) {
|
||||
blocked, _ := testBlockedEvals(t)
|
||||
|
|
|
@ -373,7 +373,7 @@ OUTER:
|
|||
|
||||
// If there are any non-terminal allocations, skip the node. If the node
|
||||
// is terminal and the allocations are not, the scheduler may not have
|
||||
// run yet to transistion the allocs on the node to terminal. We delay
|
||||
// run yet to transition the allocs on the node to terminal. We delay
|
||||
// GC'ing until this happens.
|
||||
for _, alloc := range allocs {
|
||||
if !alloc.TerminalStatus() {
|
||||
|
|
|
@ -84,9 +84,9 @@ func diffAllocs(job *structs.Job, taintedNodes map[string]bool,
|
|||
// If we are on a tainted node, we must migrate if we are a service or
|
||||
// if the batch allocation did not finish
|
||||
if taintedNodes[exist.NodeID] {
|
||||
// If the job is batch and finished succesfully, the fact that the
|
||||
// If the job is batch and finished successfully, the fact that the
|
||||
// node is tainted does not mean it should be migrated as the work
|
||||
// was already succesfully finished. However for service/system
|
||||
// was already successfully finished. However for service/system
|
||||
// jobs, tasks should never complete. The check of batch type,
|
||||
// defends against client bugs.
|
||||
if exist.Job.Type == structs.JobTypeBatch && exist.RanSuccessfully() {
|
||||
|
|
Loading…
Reference in New Issue