建立无状态 worker reconcile 边界
This commit is contained in:
@@ -5,6 +5,7 @@ package taskscheduler
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
runnerv1 "gitea.dev/actionslib/runner/v1"
|
||||
|
||||
@@ -13,6 +14,7 @@ import (
|
||||
|
||||
// Assignment is the immutable input handed to a Pod or VM provisioner.
|
||||
type Assignment struct {
|
||||
ID string
|
||||
Task *runnerv1.Task
|
||||
Identity taskidentity.Identity
|
||||
}
|
||||
@@ -38,5 +40,9 @@ func (s *Scheduler) Run(ctx context.Context, task *runnerv1.Task) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return s.Dispatcher.Dispatch(ctx, Assignment{Task: task, Identity: identity})
|
||||
return s.Dispatcher.Dispatch(ctx, Assignment{
|
||||
ID: fmt.Sprintf("gitea-task-%d", task.GetId()),
|
||||
Task: task,
|
||||
Identity: identity,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user