mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
Add server configuration option to add default set of labels for workflows that has no labels specified (#4326)
This commit is contained in:
@@ -188,6 +188,17 @@ func setupEvilGlobals(ctx context.Context, c *cli.Command, s store.Store) (err e
|
||||
server.Config.Pipeline.DefaultTimeout = c.Int("default-pipeline-timeout")
|
||||
server.Config.Pipeline.MaxTimeout = c.Int("max-pipeline-timeout")
|
||||
|
||||
_labels := c.StringSlice("default-workflow-labels")
|
||||
labels := make(map[string]string, len(_labels))
|
||||
for _, v := range _labels {
|
||||
name, value, ok := strings.Cut(v, "=")
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid label filter: %s", v)
|
||||
}
|
||||
labels[name] = value
|
||||
}
|
||||
server.Config.Pipeline.DefaultWorkflowLabels = labels
|
||||
|
||||
// backend options for pipeline compiler
|
||||
server.Config.Pipeline.Proxy.No = c.String("backend-no-proxy")
|
||||
server.Config.Pipeline.Proxy.HTTP = c.String("backend-http-proxy")
|
||||
|
||||
Reference in New Issue
Block a user