feature (server): add new error codes for downstream workers DAG (#2275)
This commit is contained in:
5 files changed
+44
No files matched your search
@@ -39,6 +39,7 @@ type options struct {
|
||||
withTestPkiWorkerAuthorized bool
|
||||
withTestPkiWorkerKeyId *string
|
||||
withWorkerType WorkerType
|
||||
withRoot string
|
||||
}
|
||||
|
||||
func getDefaultOptions() options {
|
||||
@@ -172,3 +173,10 @@ func WithWorkerType(with WorkerType) Option {
|
||||
o.withWorkerType = with
|
||||
}
|
||||
}
|
||||
|
||||
// WithRoot provides an optional root worker id.
|
||||
func WithRoot(workerId string) Option {
|
||||
return func(o *options) {
|
||||
o.withRoot = workerId
|
||||
}
|
||||
}
|
||||
@@ -164,4 +164,10 @@ func Test_GetOpts(t *testing.T) {
|
||||
opts = getOpts(WithWorkerType(KmsWorkerType))
|
||||
assert.Equal(t, KmsWorkerType, opts.withWorkerType)
|
||||
})
|
||||
t.Run("WithRoot", func(t *testing.T) {
|
||||
opts := getDefaultOptions()
|
||||
assert.Empty(t, opts.withRoot)
|
||||
opts = getOpts(WithRoot("a"))
|
||||
assert.Equal(t, "a", opts.withRoot)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user