实现持久化 assignment handoff
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
runnerv1 "gitea.dev/actionslib/runner/v1"
|
||||
|
||||
"git.ddupan.top/panxiao81/gitea-dynamic-runner/internal/taskassignment"
|
||||
"git.ddupan.top/panxiao81/gitea-dynamic-runner/internal/taskidentity"
|
||||
"git.ddupan.top/panxiao81/gitea-dynamic-runner/internal/taskscheduler"
|
||||
)
|
||||
|
||||
type fakeBackend struct {
|
||||
@@ -18,7 +18,7 @@ type fakeBackend struct {
|
||||
}
|
||||
|
||||
func (b *fakeBackend) Find(context.Context, string) (*Executor, error) { return b.executor, nil }
|
||||
func (b *fakeBackend) Create(_ context.Context, _ taskscheduler.Assignment, _ Metadata) (*Executor, error) {
|
||||
func (b *fakeBackend) Create(_ context.Context, _ taskassignment.Assignment, _ Metadata) (*Executor, error) {
|
||||
b.created++
|
||||
b.executor = &Executor{Name: "executor", IdentityTarget: "pod-uid", Phase: PhaseRunning}
|
||||
return b.executor, nil
|
||||
@@ -45,10 +45,11 @@ func (t *fakeTasks) Report(_ context.Context, _ int64, phase Phase) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func assignment() taskscheduler.Assignment {
|
||||
return taskscheduler.Assignment{
|
||||
ID: "gitea-task-42",
|
||||
Task: &runnerv1.Task{Id: 42},
|
||||
func assignment() taskassignment.Assignment {
|
||||
return taskassignment.Assignment{
|
||||
ID: "gitea-task-42",
|
||||
Backend: taskassignment.BackendPod,
|
||||
Task: &runnerv1.Task{Id: 42},
|
||||
Identity: taskidentity.Identity{
|
||||
Repository: "owner/repo",
|
||||
Task: "publish",
|
||||
|
||||
Reference in New Issue
Block a user