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
@@ -16,8 +16,9 @@ type Option func(*options)
|
||||
|
||||
// options = how options are represented
|
||||
type options struct {
|
||||
withLimit int
|
||||
withLiveness time.Duration
|
||||
withLimit int
|
||||
withLiveness time.Duration
|
||||
withUpdateTags bool
|
||||
}
|
||||
|
||||
func getDefaultOptions() options {
|
||||
@@ -43,3 +44,12 @@ func WithLiveness(liveness time.Duration) Option {
|
||||
o.withLiveness = liveness
|
||||
}
|
||||
}
|
||||
|
||||
// WithUpdateTags indicates that we should perform tag updates in the DB.
|
||||
// This would happen on first sync from a worker after startup or (eventually,
|
||||
// perhaps), after a SIGHUP.
|
||||
func WithUpdateTags(updateTags bool) Option {
|
||||
return func(o *options) {
|
||||
o.withUpdateTags = updateTags
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user