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
@@ -0,0 +1,27 @@
|
||||
package servers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// Test_GetOpts provides unit tests for GetOpts and all the options
|
||||
func Test_GetOpts(t *testing.T) {
|
||||
t.Parallel()
|
||||
opts := getOpts()
|
||||
assert.Equal(t, options{}, opts)
|
||||
|
||||
opts = getOpts(
|
||||
WithLimit(5),
|
||||
WithLiveness(time.Hour),
|
||||
WithUpdateTags(true),
|
||||
)
|
||||
exp := options{
|
||||
withLimit: 5,
|
||||
withLiveness: time.Hour,
|
||||
withUpdateTags: true,
|
||||
}
|
||||
assert.Equal(t, exp, opts)
|
||||
}
|
||||
Reference in new issue
Block a user