建立无状态 worker reconcile 边界

This commit is contained in:
2026-09-20 18:11:57 +00:00
parent 3f336310af
commit 22dc3fef63
5 changed files with 247 additions and 3 deletions
+7 -1
View File
@@ -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,
})
}