feat(handlers/host_catalogs): Support plugin host catalog worker filter

This commit is contained in:
Hugo committed 2024-09-30 21:24:18 +01:00
1 parent 7449fd6f2a
commit b8046a3ef3
12 files changed
+368 -174

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ type HostCatalog struct {
Attributes map[string]interface{} `json:"attributes,omitempty"`
Secrets map[string]interface{} `json:"secrets,omitempty"`
SecretsHmac string `json:"secrets_hmac,omitempty"`
WorkerFilter string `json:"worker_filter,omitempty"`
AuthorizedActions []string `json:"authorized_actions,omitempty"`
AuthorizedCollectionActions map[string][]string `json:"authorized_collection_actions,omitempty"`
}
+12
View File
@@ -191,3 +191,15 @@ func DefaultSecrets() Option {
o.postMap["secrets"] = 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
}
}