Add worker tagging (#862)

This allows workers to have tags assigned to them, which can then be filtered to control which targets they are allowed to serve.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-01-21 16:27:20 -05:00
1 parent 595a86508e
commit 717a3b52ee
54 files changed
+2150 -666

No files matched your search

+35
View File
@@ -3,8 +3,11 @@ package strutil
import (
"encoding/base64"
"encoding/json"
"fmt"
"reflect"
"testing"
"github.com/stretchr/testify/require"
)
func TestStrUtil_StrListDelete(t *testing.T) {
@@ -598,3 +601,35 @@ func TestStrUtil_EqualStringMaps(t *testing.T) {
}
}
}
func TestPrintable(t *testing.T) {
cases := []struct {
input string
err bool
}{
{
input: "/valid",
},
{
input: "foobarvalid",
},
{
input: "/invalid\u000A",
err: true,
},
{
input: "/invalid\u000D",
err: true,
},
{
input: "/invalid\u0000",
err: true,
},
}
for i, tc := range cases {
t.Run(fmt.Sprint(i), func(t *testing.T) {
require.True(t, Printable(tc.input) != tc.err)
})
}
}