From cf2608d1eaa44c4863453a0577af89df4bd8cba6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 9 Nov 2023 03:55:09 +0100 Subject: [PATCH] [FORGEJO] add support for the lxc:// scheme --- internal/pkg/labels/labels.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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