mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 02:35:22 +00:00
Add backend label to agents (#1692)
closes #708 Allows users to filter for a specific backend type.
This commit is contained in:
@@ -53,21 +53,6 @@ func loop(c *cli.Context) error {
|
||||
|
||||
platform := runtime.GOOS + "/" + runtime.GOARCH
|
||||
|
||||
labels := map[string]string{
|
||||
"hostname": hostname,
|
||||
"platform": platform,
|
||||
"repo": "*", // allow all repos by default
|
||||
}
|
||||
|
||||
for _, v := range c.StringSlice("filter") {
|
||||
parts := strings.SplitN(v, "=", 2)
|
||||
labels[parts[0]] = parts[1]
|
||||
}
|
||||
|
||||
filter := rpc.Filter{
|
||||
Labels: labels,
|
||||
}
|
||||
|
||||
if c.Bool("pretty") {
|
||||
log.Logger = log.Output(
|
||||
zerolog.ConsoleWriter{
|
||||
@@ -190,6 +175,22 @@ func loop(c *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
labels := map[string]string{
|
||||
"hostname": hostname,
|
||||
"platform": platform,
|
||||
"backend": engine.Name(),
|
||||
"repo": "*", // allow all repos by default
|
||||
}
|
||||
|
||||
for _, v := range c.StringSlice("filter") {
|
||||
parts := strings.SplitN(v, "=", 2)
|
||||
labels[parts[0]] = parts[1]
|
||||
}
|
||||
|
||||
filter := rpc.Filter{
|
||||
Labels: labels,
|
||||
}
|
||||
|
||||
log.Debug().Msgf("Agent registered with ID %d", agentID)
|
||||
|
||||
go func() {
|
||||
|
Reference in New Issue
Block a user