runservice: executor: provide architecture information

This commit is contained in:
Simone Gotti 2019-04-17 15:22:26 +02:00
parent d3e95ba665
commit a511fbf10c
2 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime"
"strings" "strings"
"sync" "sync"
"time" "time"
@ -650,9 +651,19 @@ func (e *Executor) archivePath(taskID string, stepID int) string {
} }
func (e *Executor) sendExecutorStatus(ctx context.Context) error { 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{ executor := &types.Executor{
ID: e.id, ID: e.id,
ListenURL: e.listenURL, ListenURL: e.listenURL,
Labels: labels,
} }
log.Debugf("send executor status: %s", util.Dump(executor)) log.Debugf("send executor status: %s", util.Dump(executor))

View File

@ -654,6 +654,8 @@ type Executor struct {
ID string `json:"id,omitempty"` ID string `json:"id,omitempty"`
ListenURL string `json:"listenURL,omitempty"` ListenURL string `json:"listenURL,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
// internal values not saved // internal values not saved
Revision int64 `json:"-"` Revision int64 `json:"-"`
} }