From dada0730b04723483552337a2fbf1c40489571bb Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 12 Oct 2022 14:44:44 +0800 Subject: [PATCH] chore(runner): add default label ""self-hosted" see https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow#using-default-labels-to-route-jobs --- poller/poller.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/poller/poller.go b/poller/poller.go index 81e8054..5f0152b 100644 --- a/poller/poller.go +++ b/poller/poller.go @@ -16,7 +16,10 @@ import ( log "github.com/sirupsen/logrus" ) -var ErrDataLock = errors.New("Data Lock Error") +var ( + ErrDataLock = errors.New("Data Lock Error") + defaultLabels = []string{"self-hosted"} +) func New(cli client.Client, dispatch func(context.Context, *runnerv1.Task) error, filter *client.Filter) *Poller { return &Poller{ @@ -53,7 +56,7 @@ func (p *Poller) Register(ctx context.Context, cfg config.Runner) error { Name: cfg.Name, Token: cfg.Token, Url: cfg.URL, - AgentLabels: []string{p.Filter.OS, p.Filter.Arch}, + AgentLabels: append(defaultLabels, []string{p.Filter.OS, p.Filter.Arch}...), CustomLabels: p.Filter.Labels, })) if err != nil {