feat(host): Add host set information to static host (#1828)

* feat(host): Add host set information to static host

Updates LookupHost and ListHost API to include sets a static host is part of, as like with plugin hosts.

* test: updated TestList_Plugin and TestCrud to be more consistent under race conditions
This commit is contained in:
Haotian authored and GitHub committed 2022-02-01 10:06:13 -08:00
1 parent 84f6cc698c
commit fa00a06bef
9 files changed
+305 -35

No files matched your search

+6
View File
@@ -104,6 +104,11 @@ func (h *Host) oplog(op oplog.OpType) oplog.Metadata {
return metadata
}
// GetSetIds returns host set ids
func (h *Host) GetSetIds() []string {
return h.SetIds
}
// hostAgg is a view that aggregates the host's value objects in to
// string fields delimited with the aggregateDelimiter of "|"
type hostAgg struct {
@@ -158,6 +163,7 @@ func (agg *hostAgg) TableName() string {
return "host_plugin_host_with_value_obj_and_set_memberships"
}
// GetPublicId returns the host public id as a string
func (agg *hostAgg) GetPublicId() string {
return agg.PublicId
}