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

+9
View File
@@ -28,6 +28,7 @@ type options struct {
withSessionMaxSeconds uint32
withSessionConnectionLimit int32
withPublicId string
withWorkerFilter string
}
func getDefaultOptions() options {
@@ -44,6 +45,7 @@ func getDefaultOptions() options {
withSessionMaxSeconds: uint32((8 * time.Hour).Seconds()),
withSessionConnectionLimit: 1,
withPublicId: "",
withWorkerFilter: "",
}
}
@@ -130,3 +132,10 @@ func WithPublicId(id string) Option {
o.withPublicId = id
}
}
// WithWorkerFilter provides an optional worker filter
func WithWorkerFilter(filter string) Option {
return func(o *options) {
o.withWorkerFilter = filter
}
}