mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-26 18:20:59 +00:00
fix!: validate runner labels aren't padded with spaces
This commit is contained in:
parent
1b08fe340e
commit
dd5ea55f62
2 changed files with 14 additions and 2 deletions
|
@ -31,6 +31,10 @@ func Parse(str string) (*Label, error) {
|
|||
Schema: "docker",
|
||||
}
|
||||
|
||||
if strings.TrimSpace(label.Name) != label.Name {
|
||||
return nil, fmt.Errorf("invalid label %q: starting or ending with a space is invalid", label.Name)
|
||||
}
|
||||
|
||||
if len(splits) >= 2 {
|
||||
label.Schema = splits[1]
|
||||
if label.Schema != SchemeHost && label.Schema != SchemeDocker && label.Schema != SchemeLXC {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue