diff --git a/internal/services/runservice/executor/executor.go b/internal/services/runservice/executor/executor.go index e408107..80a4122 100644 --- a/internal/services/runservice/executor/executor.go +++ b/internal/services/runservice/executor/executor.go @@ -27,6 +27,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "sync" "time" @@ -650,9 +651,19 @@ func (e *Executor) archivePath(taskID string, stepID int) string { } func (e *Executor) sendExecutorStatus(ctx context.Context) error { + labels := e.c.Labels + if labels == nil { + labels = make(map[string]string) + } + + // Add special labels (and override config provided ones) + arch := runtime.GOARCH + labels["arch"] = arch + executor := &types.Executor{ ID: e.id, ListenURL: e.listenURL, + Labels: labels, } log.Debugf("send executor status: %s", util.Dump(executor)) diff --git a/internal/services/runservice/types/types.go b/internal/services/runservice/types/types.go index a6d17f5..d9af754 100644 --- a/internal/services/runservice/types/types.go +++ b/internal/services/runservice/types/types.go @@ -654,6 +654,8 @@ type Executor struct { ID string `json:"id,omitempty"` ListenURL string `json:"listenURL,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + // internal values not saved Revision int64 `json:"-"` }