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:
1 parent
595a86508e
commit
717a3b52ee
54 files changed
+2150
-666
No files matched your search
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user