mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-23 15:50:47 +00:00
allow glob expresion in pipeline config for labels
This commit is contained in:
parent
5197af3ddc
commit
43ada66dde
|
@ -15,6 +15,9 @@
|
||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/bmatcuk/doublestar/v4"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc"
|
"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc"
|
||||||
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
||||||
"go.woodpecker-ci.org/woodpecker/v2/server/queue"
|
"go.woodpecker-ci.org/woodpecker/v2/server/queue"
|
||||||
|
@ -39,9 +42,11 @@ func createFilterFunc(agentFilter rpc.Filter) queue.FilterFn {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if taskLabelValue != agentLabelValue {
|
match, err := doublestar.Match(taskLabelValue, agentLabelValue)
|
||||||
return false
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("got unexpected error while try to match task and agent lable value")
|
||||||
}
|
}
|
||||||
|
return match
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue