diff options
author | Earl Warren <contact@earl-warren.org> | 2023-11-09 03:55:09 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2023-11-09 03:55:09 +0100 |
commit | cf2608d1eaa44c4863453a0577af89df4bd8cba6 (patch) | |
tree | a38e2b63744bf0119d5725bd2f61a2f8b35c9148 /internal | |
parent | no need to checkout before running cascading-pr (diff) | |
download | forgejo-runner-cf2608d1eaa44c4863453a0577af89df4bd8cba6.tar.xz forgejo-runner-cf2608d1eaa44c4863453a0577af89df4bd8cba6.zip |
[FORGEJO] add support for the lxc:// scheme
Diffstat (limited to 'internal')
-rw-r--r-- | internal/pkg/labels/labels.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/pkg/labels/labels.go b/internal/pkg/labels/labels.go index 8c38b14..6230c0b 100644 --- a/internal/pkg/labels/labels.go +++ b/internal/pkg/labels/labels.go @@ -11,6 +11,7 @@ import ( const ( SchemeHost = "host" SchemeDocker = "docker" + SchemeLXC = "lxc" ) type Label struct { @@ -32,7 +33,7 @@ func Parse(str string) (*Label, error) { if len(splits) >= 3 { label.Arg = splits[2] } - if label.Schema != SchemeHost && label.Schema != SchemeDocker { + if label.Schema != SchemeHost && label.Schema != SchemeDocker && label.Schema != SchemeLXC { return nil, fmt.Errorf("unsupported schema: %s", label.Schema) } return label, nil @@ -59,6 +60,8 @@ func (l Labels) PickPlatform(runsOn []string) string { platforms[label.Name] = strings.TrimPrefix(label.Arg, "//") case SchemeHost: platforms[label.Name] = "-self-hosted" + case SchemeLXC: + platforms[label.Name] = "lxc:" + strings.TrimPrefix(label.Arg, "//") default: // It should not happen, because Parse has checked it. continue |