feature (server): add new error codes for downstream workers DAG (#2275)

This commit is contained in:
Jim authored and GitHub committed 2022-07-22 10:18:29 -04:00
1 parent c2bfcc0664
commit b3ec54e81b
5 files changed
+44

No files matched your search

+8
View File
@@ -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
}
}
+6
View File
@@ -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)
})
}