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

+12
View File
@@ -158,3 +158,15 @@ func DefaultSessionMaxSeconds() Option {
o.postMap["session_max_seconds"] = nil
}
}
func WithWorkerFilter(inWorkerFilter string) Option {
return func(o *options) {
o.postMap["worker_filter"] = inWorkerFilter
}
}
func DefaultWorkerFilter() Option {
return func(o *options) {
o.postMap["worker_filter"] = nil
}
}
+1
View File
@@ -27,6 +27,7 @@ type Target struct {
HostSets []*HostSet `json:"host_sets,omitempty"`
SessionMaxSeconds uint32 `json:"session_max_seconds,omitempty"`
SessionConnectionLimit int32 `json:"session_connection_limit,omitempty"`
WorkerFilter string `json:"worker_filter,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
AuthorizedActions []string `json:"authorized_actions,omitempty"`